Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
i need you support in order to calculate a misure (in a table).
The problem is this: i have this formula
SUM([IMPORTO TOTALE])
with related dimensions (Month, Year, Customer) but in some cases the final result is = 0 and i don't want to see that.
I tried to use this IF(Sum([IMPORTO TOTALE])>0,SUM([IMPORTO TOTALE])) but without success.
the data I'm going to read for example are these:
YEAR MONTH CUSTOMER IMPORTO TOTALE
2020 1 ALFA 1.500
2020 1 ALFA -1.500
You probably want to use AGGR. For the dummy data that I've got, I got it to work by having a field in my table like so:
=If(AGGR(SUM([IMPORTO TOTALE]), YEAR, CUSTOMER, MONTH) > 0, YEAR )
Along with unchecking the box labeled "Include Null Values"
Dummy Data:
Data:
LOAD * Inline
[
'YEAR', 'MONTH', 'CUSTOMER', 'IMPORTO TOTALE'
2020, 1, Pasta, 1500
2020, 1, Pasta, -1500
2020, 1, Linguine, 20
2020, 1, Linguine, 45
]
;
Let me know if this helps.
You probably want to use AGGR. For the dummy data that I've got, I got it to work by having a field in my table like so:
=If(AGGR(SUM([IMPORTO TOTALE]), YEAR, CUSTOMER, MONTH) > 0, YEAR )
Along with unchecking the box labeled "Include Null Values"
Dummy Data:
Data:
LOAD * Inline
[
'YEAR', 'MONTH', 'CUSTOMER', 'IMPORTO TOTALE'
2020, 1, Pasta, 1500
2020, 1, Pasta, -1500
2020, 1, Linguine, 20
2020, 1, Linguine, 45
]
;
Let me know if this helps.
Thanks.
it works fine!
Have a nice week end
Mauro