
Re: How to calculate ratio of a value for a group compared to the group with the Max value
whiteline _ Sep 16, 2012 4:40 AM (in response to S H)Hi.
For your simple sample you can just use total qualifier:
=SUM(Cost)/Max(total Cost)
In complex cases with aggr you should also use total qualifier (in some cases with restrictions <>):
=SUM(Cost)/MAX(total AGGR( SUM(Cost), Group))

Re: How to calculate ratio of a value for a group compared to the group with the Max value
S H Sep 16, 2012 11:41 AM (in response to whiteline _)Thanks, adding the TOTAL qualifier inside the MAX fucntion worked.
I was a little confused about about when exactly the TOTAL qualifier disregards dimensions.
It appears that the TOTAL qualifier disregards dimensions unless aggregation is explicitly used in the expression (as was done with the AGGR function).
I'm curious, though, why this wouldn't also work: MAX(TOTAL SUM( TOTAL <Group> Cost)). Doesn't the <Group> I've added in the SUM also do aggregation?

Re: How to calculate ratio of a value for a group compared to the group with the Max value
whiteline _ Sep 16, 2012 11:47 AM (in response to S H)SUM( TOTAL <Group> Cost))
means that you want calculate SUM(Cost) for each Group discarding all other dimensions (except Group).

Re: How to calculate ratio of a value for a group compared to the group with the Max value
S H Sep 16, 2012 11:54 AM (in response to whiteline _)Got that. I guess I'm struggling with why wrapping that expression with MAX( TOTAL) wouldn't return the max cost among all those groups.


