Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
alespooletto
Creator
Creator

How to colour bar chart by two different master measures?

I have a bar chart that uses two different bar charts:

alespooletto_1-1714740902851.png

alespooletto_0-1714741258611.png

 

 

And I want to make it so that the two bar charts get coloured by the two different measures' values, so I made this code to put in the Colour by Expression section:

 

IF(
    VALUELIST('Availability', 'Availability Aggr.') = 'Availability Aggr.',
    IF(
        [Availability Aggr.] > '99%',
        GREEN(),
        IF(
            [Availability Aggr.] > '89%',
            RGB(255, 165, 0),
            RED()
        )
    ),
    IF(
        VALUELIST('Availability', 'Availability Aggr.') = 'Availability',
        IF(
            [Availability] > '99%',
            GREEN(),
            IF(
                [Availability] > '89%',
                RGB(255, 165, 0),
                RED()
            )
        ),
        BLACK() // Default colour
    )
)

 

 Unfortunately as you can see, it always takes the default colour. 

I saw in previous posts people suggesting to colour the maste rmeasure by segments within the master measure itself, I tried that but it didn't work as well. 

Can anybody help me solve this ? Thank you!

Labels (1)
2 Replies
paulcalvet
Partner - Specialist
Partner - Specialist

Hello,

Try this in your expression, the measure is not a text but a number :

[Availability Aggr.] > 0.99,

Regards,

alespooletto
Creator
Creator
Author

Hey @paulcalvet , thanks for your response! 

 

Unfortunately I tried to do that, but it doesn't work because it tells me that "All parameters to ValueList must be constant". 

 

Do you have anything else in mind?