Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

aggregating distinct sum?

Hello,


Can somebodey please help me?

I have a date island and would like to do a sum on some table rows but grouped by a field

for example table, with dates...

TABLE1

name     amount1     amount2         date               dateNum

A               10               10               01/01/2015        ...

A               20               10               01/01/2015

A               30               10               ...

B               11               20

B               11               20

B               22               20

C               10               10               02/01/2015

D               10               10               01/01/2015

...

In my chart i have "DateIsland.YearMonth" as dimension,

Next in my expressions for example when dimension reaches "01/2015"

For amount1 i do "=SUM(if(TABLE1.dateNum = DateIsland.dateNum, amount1))" because amount1 may be summarized as normal, so i get 114

For amount2 i would like to do a "=SUM(if(TABLE1.dateNum = DateIsland.dateNum, amount2))" but group this by name so it would only pick A=10, B=20, D=10 and show in chart only 40 and not 100

Thanks in advance for the help!

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Perhaps sum(aggr(sum(distinct if(...) ), name, DateIsland.dateNum))


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try sum( distinct if(....) )


talk is cheap, supply exceeds demand
Not applicable
Author

Hello, thanks but this is not possible because i have for also another name let's say D that has also amount 10, i have edited my start post

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Perhaps sum(aggr(sum(distinct if(...) ), name, DateIsland.dateNum))


talk is cheap, supply exceeds demand
Not applicable
Author

That seems to work for now, thank you very much!