Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
apthansh
Contributor

assigning color to text object

  if(Location='NewYork' ,

    if([Score] >=11 ,green(),

     if([Score] <=11 ,yellow(),

      if([Score] =0,red()))))

Can I use the above expression to assign colors to text objects ?

1 Solution

Accepted Solutions

Re: assigning color to text object

May be this

If(Only({<Location *= {'NewYork'}>} Location) = 'NewYork',

     If(Only({<Location *= {'NewYork'}>}[Score]) = 0, Red(),

     If(Only({<Location *= {'NewYork'}>}[Score]) <= 11, Yellow(), Green())))

View solution in original post

4 Replies

Re: assigning color to text object

This will work only if there is only one possible Location and Score are there? If you have more than one option for either of them, it might not work

apthansh
Contributor

Re: assigning color to text object

Ya...I have more locations..How can i resolve that ?

woshua5550
Contributor III

Re: assigning color to text object

Hi Ansh

plz explain more , let's say we have three locations "New York","London","Beijing"

what color would you like to show when user select more than 1 location , for example "New York"&"London"?

Re: assigning color to text object

May be this

If(Only({<Location *= {'NewYork'}>} Location) = 'NewYork',

     If(Only({<Location *= {'NewYork'}>}[Score]) = 0, Red(),

     If(Only({<Location *= {'NewYork'}>}[Score]) <= 11, Yellow(), Green())))

View solution in original post