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: 
EashwarBalaji
Contributor
Contributor

Multiple If statement not working

Hi, I'm trying to fill the background color of the following pivot table on Qlik using some conditions.

Important fields: Submitted Month, Month Due and Area

Image 1:
tempsnip.png
PS: Apologies, had to redact some info due to security reasons.

Conditions:

  1. Red - If Submitted Month <> Month Due (Irrespective of the Area)
  2. If Submitted Month = Month Due, then
    1. Green - If Area = "A"
    2. Blue - If Area = "B"
    3. Else Yellow

I tried IF([Submitted Month]<>[Month Audit Due],Red(),Green()) to check my if statement is working fine, it colored all the values to green except where Submitted Month <> Month, which was in red as expected [Ref Image 2 below].

Image 2:
tempsnip1.png

But when I add the rest of my if statement, none of the cells were colored (as shown in Image 1 above). This is the formula I used:

=IF([Submitted Month]<>[Month Audit Due],Red(),IF([Area]="A",Green(),IF([Area]="B",Blue(),Yellow()))

Can you please help me solve this issue. Thanks in advance.

Labels (2)
1 Solution

Accepted Solutions
EashwarBalaji
Contributor
Contributor
Author

Not sure if this is a technical constraint or not, but equating columns to a static text is not working. Let me explain.

I created two variables on QlikSense with the name vA and vB with values A and B respectively and used the following statement in background expression:

=IF([Submitted Month]<>[Month Audit Due],Red(),IF([Area]=vA,Green(),IF([Area]=vB,Blue(),Yellow())))

tempsnip2.png

It works perfectly fine now.

View solution in original post

1 Reply
EashwarBalaji
Contributor
Contributor
Author

Not sure if this is a technical constraint or not, but equating columns to a static text is not working. Let me explain.

I created two variables on QlikSense with the name vA and vB with values A and B respectively and used the following statement in background expression:

=IF([Submitted Month]<>[Month Audit Due],Red(),IF([Area]=vA,Green(),IF([Area]=vB,Blue(),Yellow())))

tempsnip2.png

It works perfectly fine now.