Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Nested Case statement in group by clause
Pravat
I have designed an information object by writing a SQL from different IO sources. This sql has Multiple nested Case statement's with a parameter(simple Case statements in group by clause works fine) on group by Clause.
This is showing me following error message.
ORA-00979:not a Group By expression.
I am using Actuate 10 sp1 Fix 4 IO. BIRT version :2.3.2
The parameter :rptopt is not working. How can I pass the report Grouping parameter to the information object? Is there any alternative way?
Can anybody help me with the solution.Below is the query
With (a varchar,b varchar, c timestamp)
Select
Case
When :rptopt = 'c1'
then
case when (<Field Val> between 10 and 20) or
(<Field Val> between 40 and 50)
Then 'sample field'
else 'Null'
end
Else
Case
when
(<Field Val> between 90 and 200) or
(<Field Val> between 300 and 400)
then 'Sample field'
else 'null'
end
end as 'Column header',
Case
When :rptopt = 'c2'
then
case when (<Field Val> between 10 and 20) or
(<Field Val> between 40 and 50)
Then 'sample field'
when (<Field Val> between 400 and 600) or
(<Field Val> between 700 and 800)
Then 'Others'
else 'field val'
end
End as 'Column Header',
Case
When :rptopt = 'c3'
then
case when (<Field Val> between 10 and 20) or
(<Field Val> between 40 and 50)
Then 'sample field'
when (<Field Val> between 1400 and 1600) or
(<Field Val> between 1700 and 1800)
Then 'Others'
else 'field val'
end
End as 'Column Header', Column 4 ,column 5, sum(xyz), sum(abc)
From the sample IOB[:a,:b,:c]
GROUP BY
Select
Case
When :rptopt = 'c1'
then
case when (<Field Val> between 10 and 20) or
(<Field Val> between 40 and 50)
Then 'sample field'
else 'Null'
end
Else
Case
when
(<Field Val> between 90 and 200) or
(<Field Val> between 300 and 400)
then 'Sample field'
else 'null'
end
end as 'Column header',
Case
When :rptopt = 'c2'
then
case when (<Field Val> between 10 and 20) or
(<Field Val> between 40 and 50)
Then 'sample field'
when (<Field Val> between 400 and 600) or
(<Field Val> between 700 and 800)
Then 'Others'
else 'field val'
end
End as 'Column Header',
Case
When :rptopt = 'c3'
then
case when (<Field Val> between 10 and 20) or
(<Field Val> between 40 and 50)
Then 'sample field'
when (<Field Val> between 1400 and 1600) or
(<Field Val> between 1700 and 1800)
Then 'Others'
else 'field val'
end
End as 'Column Header', Column 4 ,column 5
Thanks in advance.
PC
Find more posts tagged with
Comments
thuston
Parameters in BIRT and IOD are specified by a single ? in the SQL and then linked in the Parameters tab (in order).
:paramName is how you would have done it in eRD PRo.