Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
nishanthi_8
Contributor

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
MVP & Luminary
MVP & Luminary

Re: Background color expression in pivot table

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
Contributor

Re: Background color expression in pivot table

But I am getting a proper count in the  pivot table

MVP & Luminary
MVP & Luminary

Re: Background color expression in pivot table

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