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: 
bkn
Contributor II
Contributor II

Background Color

I have a Listbox with values Q1,Q2,Q3,Q4.. My requirement is : When I select Q1 and Q2 together , then my pivot table background will be changed base on numbers and when i select Q1 and Q2 and Q3, the background color change in Pivot Table.

How can i write expression to have the multiple value selected in ListBox ?

Thanks in Advance.

6 Replies
maxgro
MVP
MVP

if your listbox is on field1 and you want to check if Q1 and Q2 are selected (green) or possible (white)

=if(concat(distinct field1, '', field1)='Q1Q2', 1, 0)

bkn
Contributor II
Contributor II
Author

IF(FiscalQuarter='Q4' AND FiscalQuarter='Q4',

if([Sold]/[Target]>=0.138, LightGreen(),

  if([Sold]/[Target]>=0.111, Yellow(),

  if([Sold]/[Target]=0,lightRed(),lightRed())))

Can you guide me how to change this expression on your format. Please.

bkn
Contributor II
Contributor II
Author

IF(FiscalQuarter='Q1' AND FiscalQuarter='Q2',

if([Sold]/[Target]>=0.138, LightGreen(),

  if([Sold]/[Target]>=0.111, Yellow(),

  if([Sold]/[Target]=0,lightRed(),lightRed())))

Can you guide me how to change this expression on your format. Please.

Anonymous
Not applicable

Hello.

Using Massimo's idea, your expression would be like this:

if(Concat(Distinct FiscalQuarter, '', FiscalQuarter) = 'Q1Q2',

if([Sold]/[Target]>=0.138, LightGreen(),

  if([Sold]/[Target]>=0.111, Yellow(),

  if([Sold]/[Target]=0,lightRed(),lightRed())))

Hope it helps.

its_anandrjs
Champion III
Champion III

Another way of doing this with Getfieldselections

=if(Replace(GetFieldSelections(FiscalQuarter), ',','') = 'Q1 Q2',

  if([Sold]/[Target]>=0.138, LightGreen(),

  if([Sold]/[Target]>=0.111, Yellow(),

  if([Sold]/[Target]=0,lightRed(),lightRed() ) ) ) )

bkn
Contributor II
Contributor II
Author

Thanks, it works ...