Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
jfung148
Creator
Creator

Question about AGGR

hi all

I know there are tons of posts about AGGR but I cant seem to understand it.. or how it ends up truly working..

I guess im trying to see if someone can help explain it in a more simplified manner maybe..

like why use aggr... what other type of commands are there besides AGGR...

the difference between  AGGR(sum(blah blah)  vs   SUM(AGGR(Sum(blah blah)

how it affects or not affects showing subtotals..

maybe some examples with simple math.. that can make it easy to understand..

sorry this makes my head spin

thanks all

1 Solution

Accepted Solutions
bgerchikov
Partner
Partner

Hi Jackie,

If you're familiar with SQL, you can consider AGGR function as an analog to GROUP BY statement.:

Select

       Customer_ID,

       Location,

       SUM(Amount)

From Table1

Group By

      Customer_ID,

       Location

Analog to AGGR(sum(Amount) ,  Customer_ID, Location) .

This expression returns the list of SUMs

Now, you may need to aggregate the  list of SUMs above and to use it in the chart

Avg( AGGR(sum( Amount) ,  Customer_ID, Location))

Or you need the most successful customer:

Max(AGGR( sum( Amount) ,  Customer_ID, Location))

Hope it will help

View solution in original post

1 Reply
bgerchikov
Partner
Partner

Hi Jackie,

If you're familiar with SQL, you can consider AGGR function as an analog to GROUP BY statement.:

Select

       Customer_ID,

       Location,

       SUM(Amount)

From Table1

Group By

      Customer_ID,

       Location

Analog to AGGR(sum(Amount) ,  Customer_ID, Location) .

This expression returns the list of SUMs

Now, you may need to aggregate the  list of SUMs above and to use it in the chart

Avg( AGGR(sum( Amount) ,  Customer_ID, Location))

Or you need the most successful customer:

Max(AGGR( sum( Amount) ,  Customer_ID, Location))

Hope it will help

View solution in original post