Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
poojashribanger
Creator II
Creator II

Aggregation in Qlik Sense

Hi,

I have date and 3 measure

by default total of qlik sense is giving me wrong numbers .

i have attached image please check

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi, 

Try aggr function like below.

Sum(Aggr(Sum(XYZ),Date))

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

5 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi, 

Try aggr function like below.

Sum(Aggr(Sum(XYZ),Date))

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
poojashribanger
Creator II
Creator II
Author

same thing if i want to do in bar chart .

where i have dimension quarter(inline loaded) and measure is like

if(dim='M1',exp,

if(dim='M2',exp,

if(dim='M3',exp,

if(dim='M4',exp))))


how to implement here

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Then your if statement will be

if(dim='M1',Sum(Aggr(exp),Dim),

if(dim='M2',Sum(Aggr(exp),Dim),

if(dim='M3',Sum(Aggr(exp),Dim),

if(dim='M4',Sum(Aggr(exp),Dim)))))


Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
poojashribanger
Creator II
Creator II
Author

not working for me

because even dimension i am calculating

like

if(timeline='M1','FY'&right(YearStart(AddYears(max([Date]),-1),0,4),2),

if(timeline='M2','FY'&right(YearStart(AddYears(max([Date]),-1),-1,4),2)))

jonathandienst
Partner - Champion III
Partner - Champion III

Measure with ratios or the DISTINCT keyword are usually not additive, so the sum of rows is not equivalent to the expression calculated at the total level (which is what Qlik does by default). To get a column sum, use and Aggr() function with all the pivot table dimensions with this pattern:

     Sum(Aggr(.... your expression ...., dim1, dim2, ...))

Insert your expression in the placeholder above and include all the chart dimemension

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein