Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Avg of Sum in Pivot

Hi,

I am trying to come up with a margin figure based on the following calculation:

=AVG(IF(DWH_OP_DATE_YEAR=ThisYear AND DWH_OP_DATE_PERIOD=ThisPeriod,(SALES_VALUE_NET - COST_VALUE_NET)

/SALES_VALUE_GROSS))

But I want sum of sales value net - sum of cost value net / sum of sales value gross.

How can i achieve this?!

I've tried putting sum in front of each value but it always comes back with null.

Any help greatly appreciated!

0 Replies