Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
New Contributor

Aggr Count Distinct function

I am struggling with getting total in Qliksense to match the totals if i export hte data to excel and sum the column.

The expression in the measure is:


I understand the arrg function is what i need to use and it works perfectly on other columns with simpler expression but i cannot get it to work with this.

I have tried various methods including:


       count(aggr(only(distinct(Pol_ID)),Pol_ID))*Sum(aggr( only(Total_U_Adq/Total_U),Total_U_Adq/Total_U)



But nothing i do works, can somebody please help me?

Thanks in advance

2 Replies

Re: Aggr Count Distinct function

What dimensions do you use when you export the chart to the Excel? 

MVP & Luminary
MVP & Luminary

Re: Aggr Count Distinct function

The reason for the difference between the total line and the sum of individual lines is the DISTINCT count - if some of the line results should be duplicated, they will get de-duplicated at the total.

If you want the total to be a sum of line values, you can simply modify the Totals Function to "Sum", and that will do the trick. 

If you want to solve the same problem using AGGR, then the syntax would be the following:



                   count(distinct .....),

                   Dim1, Dim2, Dim3, ...



where Dim1, Dim2, Dim3  are your chart dimensions.



Oleg Troyansky