Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

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
Valued Contributor III

Re: how to apply background color using multiple if statement

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
Valued Contributor

Re: how to apply background color using multiple if statement

if(budget=1, green,

    if(budget =2, orange,

          if(budget=3, red)))

lucasmarsola
New Contributor III

Re: how to apply background color using multiple if statement

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

Re: how to apply background color using multiple if statement

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

Feeling Qlikngry?

How To /Missing Manual(18 articles)

Partner
Partner

Re: how to apply background color using multiple if statement

Hi ipsita,

worked example attached!

HTH - Andy

engishfaque
Valued Contributor III

Re: how to apply background color using multiple if statement

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

Not applicable

Re: how to apply background color using multiple if statement

Thank u Ahmed.It worked..