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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
SilviyaK
Contributor III
Contributor III

Pivot with Conditional Measure - Total is Blank

Hi,

Can I please get come help with the below:

I have the following in a simple table:

SilviyaK_0-1733153255645.png

From 'Totals Function' I can select the the totals function to be a sum and it shows me the total (10).

If I do exactly the same in a pivot though, this happens:

SilviyaK_1-1733153316149.png

How can I make it show the total (10) in a pivot table? There is no totals function or anything equivalent.

This is just a sample, the original data needs to exist in a pivot in order to fulfil the rest of the requirements for the view. 

Thanks! 

 

Labels (2)
1 Solution

Accepted Solutions
MatheusC
Specialist II
Specialist II

Hi, @SilviyaK 
Try putting the values ​​resulting from your condition inside a sum(),

Sum(
if(_Country='Belgium',2,
if(_Country='France',5,
if(_Country='Germany',3))))

*****************************************************************************

Below is my example in the pick() function

sum(pick(match(_Country,'Belgium','France','Germany'),2,5,3))

MatheusC_0-1733164492591.png

 

 

*****************************************************************************

If possible too, you could be taking the condition to the script.


- Regards, Matheus

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!

View solution in original post

2 Replies
MatheusC
Specialist II
Specialist II

Hi, @SilviyaK 
Try putting the values ​​resulting from your condition inside a sum(),

Sum(
if(_Country='Belgium',2,
if(_Country='France',5,
if(_Country='Germany',3))))

*****************************************************************************

Below is my example in the pick() function

sum(pick(match(_Country,'Belgium','France','Germany'),2,5,3))

MatheusC_0-1733164492591.png

 

 

*****************************************************************************

If possible too, you could be taking the condition to the script.


- Regards, Matheus

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!
SilviyaK
Contributor III
Contributor III
Author

Thanks! I also found that it works this way too:

Sum(Aggr(
if(_Country='Belgium',2,
if(_Country='France',5,
if(_Country='Germany',3))), _Country))