Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
blipblopdk
Creator
Creator

Exclude certain rows in pivot table from sum

In the attached example, I cannot find a way to calculate the column to the right (column 3) correctly.

Column 3 is generally calculated as the difference between column 1 and 2 (see measure below).

In rows where column 1 is 0, no value should be shown in column 3. This I have achieved as shown in the example.

The problem is that the row marked with yellow does not sum to what I want. As it is now, it sums to 238, but I want it to sum to 308. Right now, the sum incorporates the difference between column 1 and 2 for those rows where column 0 is 0, and I would like it to NOT include those differences, so it should only include differences, where column 1 is NOT 0.

It would be easily solved, if I just added "{<[Udbudte pladser] -= {0}>}" to the second part of the measure. Unfortunately, this is not possible with the way my data are structured right now since "[Udbudte pladser]" lies in one set of rows and "[CPR-nummer]" lies in a different set of rows. I could probably do some "tricks" in the data load to make up for this. But do you see other ways to achieve what I want?

BR Kim

blipblopdk_1-1653887367861.png

 

 

Labels (2)
0 Replies