on 01-22-2009 8:52 AM
Hi,
Please help me on this. How do I set the value to zero for each aggregate awareness when the denominator is zero. Below is my select statement in the universe measure.
@Aggregate_Aware(sum(column1/column2),sum(column3/column4),sum(column5/column6))
Thank you in advance.
Rose
Hi Rosemarie,
You can use a case statement
case when column2 = 0 then 0 else column1/column2 end
This can be embedded directly in your Aggregate_Aware function
@Aggregate_Aware(sum(case when column2 = 0 then 0 else column1/column2 end),sum(column3/column4),sum(column5/column6))
(Note you will need to change all of them )
but for clarity it might be better to create a new object, my_object
defined as
case when column2 = 0 then 0 else column1/column2 end
and then
@Aggregate_Aware(sum(@select(my class\my object)),sum(column3/column4),sum(column5/column6))
Hope this helps
Alan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alan,
Thank you so much for your help. The code is working fine.
More power to you.
Thank you.
Rose
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.