Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
winda_putri
Contributor
Contributor

Color Expression not apply in all dimension

Hi There

i have barc hart with dimension trend 13 month, I want to change color of Bars as per dimension.

with expresion :

=if([Main Product]='Group 1',blue(255),
if([Main Product]='Group 2',red(255),
if([Main Product]='Group 3',green(255))))

 

and i have filter pane in jun 2023, so why the color expresion just apply ini jun 2023 not in all trend 13 months

winda_putri_0-1687856485505.png

 

 

Thanks for your help.

Labels (4)
2 Solutions

Accepted Solutions
Or
MVP
MVP

Seems like it would be easier to define Master Item colors rather than do this?

In any case, I believe that since you've selected Jun 2023, none of the other months are in the Possible data, and as such, none of them are associated with available values for Main Product. This means that the result of your if() formula will be null for all of those values.

You could wrap the entire expression in a set using Only() and it'll probably work. But I'd still suggest using the Master Item colors instead.

Only({1} if([Main Product]='Group 1',blue(255),
if([Main Product]='Group 2',red(255),
if([Main Product]='Group 3',green(255)))))

 

View solution in original post

winda_putri
Contributor
Contributor
Author

Hi... thanks for your help

thanks for your suggest for use master item colors and its more simple

View solution in original post

2 Replies
Or
MVP
MVP

Seems like it would be easier to define Master Item colors rather than do this?

In any case, I believe that since you've selected Jun 2023, none of the other months are in the Possible data, and as such, none of them are associated with available values for Main Product. This means that the result of your if() formula will be null for all of those values.

You could wrap the entire expression in a set using Only() and it'll probably work. But I'd still suggest using the Master Item colors instead.

Only({1} if([Main Product]='Group 1',blue(255),
if([Main Product]='Group 2',red(255),
if([Main Product]='Group 3',green(255)))))

 

winda_putri
Contributor
Contributor
Author

Hi... thanks for your help

thanks for your suggest for use master item colors and its more simple