Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
noviceneil
Partner - Contributor III
Partner - Contributor III

How to create filters on color

Hello Experts,  

                              I always come to you with expectations of getting some solution and always I received some. Thanks.

 

I have 2 columns in a table  where I have current value and previous value and based on that I calculate the % of value difference in Qliksesnse through  a new measure say "% DIFF" and I color  the field in a PIVOT table  by checking it's value for some ranges like , >50% RED(), >30%, AMBER and rest GREEN.

Now I want to have a filter where  the user will be able to filter on these percentages or COLOR codes. Say if the user wants to see only the RED colors or >50%. Can someone please help.

 

1 Solution

Accepted Solutions
PradeepK
Creator II
Creator II

As data in selection state will change as per diff filters.. you need to create Calculated Dimension

Use below template:

Aggr(
if(<Master Measure> <condition> , <Required Values>)
,<Dim List>
)

 

Example

Master measure: (Growth)

( sum(Sales) / sum(PreviousSales) ) - 1

 

Master Dimension:(Color)

=Aggr(
  if(Growth < 0 , 'Red', 'Green')
  ,Month
)

 

Result:

DynamicColorCode.gif

 

View solution in original post

2 Replies
PradeepK
Creator II
Creator II

As data in selection state will change as per diff filters.. you need to create Calculated Dimension

Use below template:

Aggr(
if(<Master Measure> <condition> , <Required Values>)
,<Dim List>
)

 

Example

Master measure: (Growth)

( sum(Sales) / sum(PreviousSales) ) - 1

 

Master Dimension:(Color)

=Aggr(
  if(Growth < 0 , 'Red', 'Green')
  ,Month
)

 

Result:

DynamicColorCode.gif

 

zahra
Contributor II
Contributor II

Is the color filtering possible with a straight table with more than one Dimension?  I have more than one dimension and when I aggregate if statement by all 3 dims, I am still getting other colors showing when I filter by each color.   Please help!