Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Conidtional computed field
msoucy
I want to add a computed field to my BIRT report. The computed field will be a total of a column in my report. I want to the total to be conditional in that I only want to add to the total if the value in one of the columns meets a certain condition. I've tried using an IF statement but, have not been able to make it work. Can someone give an example of how you would do this?
Find more posts tagged with
Comments
SailRCG
Hi,
I think you are trying to do what I've done in the attached example.
To do the conditional aggregation (SUM), you'll use the expression builder. Depending on the table grouping, you'll either be subtotaling or creating a grand total. The If syntax is basically 'if("someColumn"=="something"){"ColumnToBeAggregated"}' That's it, the aggregation wizard handles the type of aggregation, applied based on the evaluation of the if().
To show this, I've created two identical columns, each aggregated differently (based on if the "Product Code" starts with 'S10').
I hope this helps,
Ralph G
msoucy
Hi Ralph,
Thanks for the help. I'll give that a try.
Mike