Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hey all
please my question is i have this table
has duplicate in ids but i need to calculate the sum of amount ignoring the duplicates i dont want to do the sum for the same iD twice:
ID Amount
1 1000
1 1000
2 2000
3 1500
3 1500
4 2500
sum(amount)=7000
1000+2000+1500+2500 ( this the sum that i want )
ihave to use distinct ID if yes how can i use it
Thanks
distinct them while you load them
tablename:
load distinct
ID, Amount from .....
Use this expression in your chart: (ID as dimension)
Sum(Aggr(Amount, ID))
In the front end you can try this expression in a text box:
=Sum(Aggr(Avg(Amount), ID))
if ia have many dimenssion in my table example
ID type sort amount
it should be like this Sum(Aggr(Amount, type ,sort,ID)) ?
If you want distinct across all the dimensions, then add those as well.
Maybe, I should have to take a look to the document
=Sum(DISTINCT Amount)