Qlik Community

Qlik Sense App Development

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

tomtastic
New Contributor II

Incorrect average total in pivot table

Hi,

I use the following measure to calculate my percentages per Year/Month:
Count(distinct [PurchDoc])/count(total< [Year/Month] >distinct [PurchDoc])


I expected the pivot table to calculate the average of the percentages for each column in the totals. Yet when I compare the totals from Qlik Sense with the average I calculated in Excel there is a difference for one column (53% instead of 56%).

Why is this?

1 Solution

Accepted Solutions

Re: Incorrect average total in pivot table

Hi,

The expression works well.

Here is the QVF.

Also the Screenshot.

Capture.PNG

Regards,

Kaushik Solanki

8 Replies

Re: Incorrect average total in pivot table

Can you try this:

Avg(Aggr(Count(distinct [PurchDoc])/count(total< [Year/Month] >distinct [PurchDoc]), [Year/Month], [Buying Channel]))

Re: Incorrect average total in pivot table

Hi,

Try this expression,

Avg(Aggr(Count(distinct [PurchDoc])/count(total< [Year/Month] >distinct [PurchDoc]),[Buying Channel]))


Regards,

Kaushik Solanki


tomtastic
New Contributor II

Re: Incorrect average total in pivot table

I tried both expressions but it still displays an incorrect average of 53%.

Re: Incorrect average total in pivot table

Would you be able to share a sample?

tomtastic
New Contributor II

Re: Incorrect average total in pivot table

No problem. See attachment.

Re: Incorrect average total in pivot table

Hi,

The expression works well.

Here is the QVF.

Also the Screenshot.

Capture.PNG

Regards,

Kaushik Solanki

Re: Incorrect average total in pivot table

Precisely, I think you might have just checked one expression and forgot to check mine. This one does seem to work:

Avg(Aggr(Count(distinct [PurchDoc])/count(total< [Year/Month] >distinct [PurchDoc]), [Year/Month], [Buying Channel]))

Highlighted
tomtastic
New Contributor II

Re: Incorrect average total in pivot table

You're right. The expression works well. I was just implementing it in the wrong area. I thought it was to be inserted in the totals.

Community Browser