Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum(total<Sales> AGGR()) With dimensions

I have this question,

Say I have two dimensions, country and date, each with 20 or more value;

I want to sum the value of sales on a pivot table with date as the dimension.

I want to use AGGR() because for each country there will be a different adjustment factor.

Anyone has any idea how to do this? Currently when I apply Sum(TOTAL<Country> aggr(sum(Sales)*Function,Country))

where the function is suppose to give different values according to the country selection.

It doesen't work. It give me one value in one of the date column and the rest is 0. I want it to give me the sum by different dates.

Any help/Insights will be really appreciated! Thank you!

Michael

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try sum(aggr(sum(Sales)*only(Function),Country,Date))


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

Try sum(aggr(sum(Sales)*only(Function),Country,Date))


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you very much Gysbert, it works! And the formula is clean and neat compare to the jumbo I had.

And it improves performance as well. I think how much it improves depends on how long the original formula is.

In my case it went down from ~3s to less than 2s.