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

Background color expression in pivot table

if((Count( {<[Module 1]={'Completed'}>}[user name]))

/

(Count( {<[Module 1]={'Completed'}>}[user name])

+

Count( {<[Module 1]={'Not Completed'}>}[user name]))

<100.00,rgb(255,102,102),rgb(102,204,0))


The above expression works individually but i if i give numerator the else part is not at all executed for background color expression?

Is there any solution ?

3 Replies
Gysbert_Wassenaar

No, A/(A+B) will always be smaller than 100 if A and B are larger than or equal to zero as long as not both A and B are zero. In fact it will always be smaller or equal to 1.


talk is cheap, supply exceeds demand
nishanthi_8
Creator
Creator
Author

But I am getting a proper count in the  pivot table

Gysbert_Wassenaar

That doesn't change the mathematics. The result of a number larger or equal to zero divided by the sum of itself and another number larger or equal to zero can never be larger than one (as long as not both are zero which results in infinity), never mind 100. So the test in your if statement will always return true and your if statement will never execute the second branch.


talk is cheap, supply exceeds demand