Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all..
I have a table with this layout
Id | date | Num1 | Num 2 | Total |
---|---|---|---|---|
1 | xx | 10 | 11 | -1 |
2 | xx | 14 | 10 | 4 |
3 | xx | 20 | 6 | 14 |
total | 18 (-1 shouldn't be sum) |
I want a table that only show the sum where num1 is greater than num2. The total would be the sum of that condition. Can this be achieved on any type of table?
Thanks
Try:
if(Dimensionality()=0,
sum(aggr(if(sum(Num1-[Num 2])>0,sum(Num1-[Num 2]),0),Id,date))
,sum(Num1-[Num 2]))
It almost did the job. this example maybe didn't help a lot, but with a little change to:
sum(num1)-sum(num2) did the trick. thanks!
Try this,
Sum({<Total={">0"}>}Total)