Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
harrywu1
Contributor III
Contributor III

The rationale of Aggr()? When and how to use it?

Hi,

Today I used Aggr() to show the total in Pivot table, instead of just turning on the "Partial Sums" in chart properties.

But, what is the Aggr() 's rationale behind ?

I view it this way Aggr( expression, dimension1, dimension2, ....)

But, they came out the different results when applying different dimensions, even with the same data.

So, every time users change the dimensions in Rows or Columns of the pivot table, they have to revise the Aggr() content accordingly?

And if there's another chart or list box where I show the count of the possible values at the caption (assuming they're all distinct),

but this count is different from the pivot's sum.    That's just a chaos, and driving the boss crazy, when seeing this...

Can someone help explain when and how to nicely use Aggr() ?

And, do I have to use Aggr() as well, if I want to show the count of values at the caption of other kinds of charts/boxes ?

Thank you!

2 Replies
Anonymous
Not applicable

Hi Harry,

As per my understanding, "Aggr( expression, dimension1, dimension2, ....) "will give you an virtual table by aggregating the Expression results by the dimensions you are passing to it.

EX: consider the below Sample data

STID ID TID
1 1 123
1 1 456
1 2 963
1 2 258
1 2 741
1 3 789
1 3 654
1 3 123
1 3 951

from the above data I want to add all the TIDs of STID with a delimiter ',' in a single row. to get the below result I am using =AGGR(Concat(DISTINCT TID,','),STID)

here the expression is Concat(Distinct TID,',') and I need these grouped by STID. though we have ID as dimesion it will discard(since the grain is not finer) it and it will group the results by the dimension we have mentioned.

Hope it will be helpful!!

Best Regards,

Ashok