Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
rajany089
Contributor II
Contributor II

Color Expression issue with Dimension group

Hi Team,

I've created a bar graph in Qlik, where I've organized the data by month to visualize both January and February. Each bar represents four months of data; for example, in the January bar graph, I'm displaying data from October, November, December, and January. I've implemented a condition in the graph where the color of the bar changes based on certain criteria. If the percentage of the smallest month's classification is less than 100%, the bar turns red. If it equals 100%, the bar turns green. Otherwise, all other months will be represented in blue. This condition is working correctly for January, but not for February. What might be the reason for this discrepancy?
 
Formula used in Color expression:
 
if((['Month-Year']) = Min(total(['Month-Year'])) and [Percentage Classified] < '100.0%' and ['Month-Month'] = 'January' or ['Month-Month'] = 'February', 'Red', 
If((['Month-Year']) = Min(total(['Month-Year'])) and [Percentage Classified] = '100.0%' and ['Month-Month'] = 'January' or ['Month-Month'] = 'February', 'Green', 'Blue'))

 

Attached are the visualization that i need and currently i am getting

 

@sunny_talwar Qlik Sense Business 

Labels (3)
2 Replies
Rohan
Specialist
Specialist

Hi Raj,

I think since you have used min total, it is only working for the overall min month, whereas you need it to check for min month-year for each month-month. Try something like this once :

if((['Month-Year']) = Min(total<[Month-Month]>(['Month-Year'])) and [Percentage Classified] < '100.0%' and ['Month-Month'] = 'January' or ['Month-Month'] = 'February', 'Red', 
If((['Month-Year']) = Min(total<[Month-Month]>(['Month-Year'])) and [Percentage Classified] = '100.0%' and ['Month-Month'] = 'January' or ['Month-Month'] = 'February', 'Green', 'Blue'))
 
Regards,
Rohan.
Chanty4u
MVP
MVP

Try this

if(

    (['Month-Year']) = Min(total(['Month-Year'])) and [Percentage Classified] < '100.0%' and (['Month-Month'] = 'January' or ['Month-Month'] = 'February'), 

    'Red', 

    If(

        (['Month-Year']) = Min(total(['Month-Year'])) and [Percentage Classified] = '100.0%' and (['Month-Month'] = 'January' or ['Month-Month'] = 'February'), 

        'Green', 

        'Blue'

   )

)