Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
brunolelli87
Creator II
Creator II

Setting different color via Expression

Hello guys,

I'm using the following expression to color my bars depending on its value...
If it's above the TTOAL average (red), otherwise (green)

 

IF(AVG(TOTAL FSPLU) > AVG(FSPLU), color(3), color(2))

 

 

But, in this case, if the user selects some bars, the system will recalculate the colors again based on the available remaining bars.

How can do not change the colors in this case?
I mean, once it's calculated the colors should not change anymore upon users' selection.


Would that be as simple as replacing the TOTAL by ALL?

IF(AVG(ALL FSPLU) > AVG(FSPLU), color(3), color(2))

 

Thanks

 

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You will still need TOTAL

 

IF(AVG({1} TOTAL FSPLU) > AVG(FSPLU), color(3), color(2))

 

{1} and ALL are the same. ALL was deprecated when replaced by {1} and ALL was meant to be removed from the product. However, the removal never happened.

-Rob 

View solution in original post

3 Replies
Saravanan_Desingh

So, do you want to compare the overall AVG with currently selected AVG?

IF(AVG({1}FSPLU) > AVG(FSPLU), color(3), color(2))
brunolelli87
Creator II
Creator II
Author

What's the difference between 1 and ALL?

Thanks
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You will still need TOTAL

 

IF(AVG({1} TOTAL FSPLU) > AVG(FSPLU), color(3), color(2))

 

{1} and ALL are the same. ALL was deprecated when replaced by {1} and ALL was meant to be removed from the product. However, the removal never happened.

-Rob