Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

poojashribanger
Contributor 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

Re: Aggregation in Qlik Sense

Hi, 

Try aggr function like below.

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

Regards,

Kaushik Solanki

5 Replies

Re: Aggregation in Qlik Sense

Hi, 

Try aggr function like below.

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

Regards,

Kaushik Solanki

poojashribanger
Contributor II

Re: Aggregation in Qlik Sense

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

Re: Aggregation in Qlik Sense

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

poojashribanger
Contributor II

Re: Aggregation in Qlik Sense

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)))

MVP
MVP

Re: Aggregation in Qlik Sense

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