Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Folks,
i got a situation, for instance: my data-area does look like:
Project,Type, Turnover, Cost
1, A, 75, 90
2, B, 75, 78
3, C, 36, 35
i created 2 Variables:
Sum({<Typ = {'*'}>}Turnover) and Sum({<Typ = {'*'}>}Turnover) i want to compare 2 Variables, if my Turnover is lower than my Cost, then the Cost need to be taken
expected output is:
Project, Type, Turnover, Cost, Compare Ratio
1, A, 75, 90, 90
2, B, 75, 78, 78
3, C, 36, 35, 36
--------------------------------------------------------------------------
186 203 204
does any body have any idea ?
Thanks a lot
Beck
This will work on row level... but to get the right total also, you might need to use Sum(Aggr())...
Sum(Aggr(RangeMax($(vTurnover),$(vCost)), Project))
This can be done using if expression also,
if(Turnover>Cost,Turnover,Cost) as new_field.
In case you can use other than variables.
May be this
Sum({<Type = {"*"}>} RangeMax(Turnover, Cost))
Hi Sunny,
thanks a lot for your feedback and help,
This was my first option as well, i want ask you, can i compare this way 2 Variables ?
Thanks a lot
Beck
Hi aparna,
thanks a lot for your feeback, but this the wrong way, if i use 'if then', so my total sum has a deviation in total.
Beck
can i compare this way 2 Variables ?
Not sure I understand what this means?
Sunny : this way: Sum({<Typ = {'*'}>} RangeMax(Turnover,Cost)) is cool.
but i created 2 Variables:
Sum({<Typ = {'*'}>}Turnover) = vTurnover
Sum({<Typ = {'*'}>}Cost) = vCost
Can i compare those variables ? Can i make that so: Sum({<Typ = {'*'}>} RangeMax($(vTurnover),$(vCost))) ?
thanks a lot
Beck
This will work on row level... but to get the right total also, you might need to use Sum(Aggr())...
Sum(Aggr(RangeMax($(vTurnover),$(vCost)), Project))
Thanks a lot Sunny for your help and feedback.
it does work