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: 
Not applicable

how to apply background color using multiple if statement

How to write an expression in QlikView for multiple if.

If(budget=1,back ground color green)if (budget=2,background color orange,if budget=3,back ground color red)

pls suggest

1 Solution

Accepted Solutions
engishfaque
Specialist III
Specialist III

Dear Ipsita,

There are 3re ways to apply background colors,

1st Way: Please note, there is no orange color function into QlikView. Therefore, Orange color will not work and you have to use color code such as, mentioned in 2nd Way:

=If (budget = 1, Green(),

      If (budget = 2, Orange(),

        If (budget = 3, Red())))


2nd Way:

=If (budget = 1, RGB(0,255,0),

      If (budget = 2, RGB(255,153,0),

        If (budget = 3, RGB(255,0,0))))

3rd Way: (Best way for big projects)

Create variables for each color and use them where you need, such as given below:


Settings > Variable Overview > Add > variableName ( ex. vColorGreen ) > Select Variable > Give value into variable Definition ( ex. RGB(0,255,0) )

vColorGreen = RGB(0,255,0)

vColorOrange = RGB(255,153,0)

vColorRed = RGB(255,0,0)

=If (budget = 1, $(vColorGreen),

      If (budget = 2, $(vColorOrange),

        If (budget = 3, $(vColorRed))))

Kind regards,

Ishfaque Ahmed

View solution in original post

6 Replies
manideep78
Partner - Specialist
Partner - Specialist

if(budget=1, green,

    if(budget =2, orange,

          if(budget=3, red)))

Anonymous
Not applicable
Author

if(budget=1, back ground color green, if (budget=2, background color orange, if (budget=3,back ground color red)))

robert_mika
Master III
Master III

=if(budget=1, green(), if(budget =2, rgb(255,128,64),if(budget=3, red())))

Feeling Qlikngry?

How To /Missing Manual(18 articles)

awhitfield
Partner - Champion
Partner - Champion

Hi ipsita,

worked example attached!

HTH - Andy

engishfaque
Specialist III
Specialist III

Dear Ipsita,

There are 3re ways to apply background colors,

1st Way: Please note, there is no orange color function into QlikView. Therefore, Orange color will not work and you have to use color code such as, mentioned in 2nd Way:

=If (budget = 1, Green(),

      If (budget = 2, Orange(),

        If (budget = 3, Red())))


2nd Way:

=If (budget = 1, RGB(0,255,0),

      If (budget = 2, RGB(255,153,0),

        If (budget = 3, RGB(255,0,0))))

3rd Way: (Best way for big projects)

Create variables for each color and use them where you need, such as given below:


Settings > Variable Overview > Add > variableName ( ex. vColorGreen ) > Select Variable > Give value into variable Definition ( ex. RGB(0,255,0) )

vColorGreen = RGB(0,255,0)

vColorOrange = RGB(255,153,0)

vColorRed = RGB(255,0,0)

=If (budget = 1, $(vColorGreen),

      If (budget = 2, $(vColorOrange),

        If (budget = 3, $(vColorRed))))

Kind regards,

Ishfaque Ahmed

Not applicable
Author

Thank u Ahmed.It worked..