Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Mitch_Data
Contributor III
Contributor III

Pivot Total is wrong in some instances. Set Analysis

Hello,

 

I have a problem which I can't seem to solve and I do not know if it possible at all in Qliksense.

Problem:

 

I have a couple of fields that I need. First of all:

Field 1 = "OKS" this can equal a '0' or 'random name'
Field 2 = "contractsoort" this can equal "G" or "O"
Field 3 = "Verkoopresultaat inc. correcties" this equals a number(value)

First what I want to do is this. I made a set analysis like below.

IF(OKS <> '0' and contractsoort = 'O', Sum(${<OKS-={'0'}>} 0),
AVG(${<OKS={'0'}>+<OKS-={'0', contractsoort = {'G'}>}[Verkoopresultaat Inclusief Correcties]))

 

OKS <> 0 and contractsoort = 'O' normally have a normal result for the field Verkoopresultaat inclusief correcties (so for instance €5.000-)  but I want that result to be set to €0 when they meet the requirements of the first set analysis.

Basically what I want in here is that if OKS <> 0 AND Contractsoort = 'O' to set the result to 0 then for all else I want the verkoopresultaat inclusief correcties. However I want the 0 of the first set analysis to be calculated together with the average of the second analysis. 

 

Now in my pivot table when I select OKS <> '0' and contractsoort = 'O' all my results show 0 , and that is what I want.

 

Mitch_Data_0-1655719178133.png

 

However, when I select as a filter OKS <> '0' and contractsoort = 'G' AND 'O' then my average total in the pivot shows the average as if the value was not set to €0,- but it's original value. The below screenshot should average €49,33 but the total of my pivot states €1497,-. That is because the original value for GZ-554-N is €4343, so it doesn't really see it as a €0,-.

 

Mitch_Data_1-1655719420569.png

 

I wonder how I can force the pivot to see it as a €0,-.

 

Any further questions or pointers are appreciated. I am looking forward to your answers!

 

Labels (4)
0 Replies