Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear
I have an expression in which I want the following:
sum(if(ColA+ColB >5000) Amount)
this works fine but is there an alternative way to accomplish this using set analysis instead of if statement
Please advise
A set analysis expression is only possible if you have a field that unique identifies the records.
sum({<KeyField={'=ColA+ColB>5000'}>}Amount)
ColA and ColB also need to be field names, not column labels. And if they are part of the same table then create a flag field in the script instead:
Load ColA, ColB, if(ColA+ColB>5000,1,0) as Flag
From mysource;
The expression can then become sum({<Flag={1}>}Amount)
Hi,
You can also the same in script and arrive a new flag dimension like this
LOAD
*,
if(ColA+ColB >5000, 1) AS Falg
FROM DataSource;
Now in the chart just use this
=Sum({<Falg = {1}>} Amount)
Hope this helps you.
Regards,
Jagan.
is it necessary to have a key field or it works on any field? please explain via an example if possible and please clarify technical reasons