Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
amruta_j
Partner - Contributor III
Partner - Contributor III

Bar Chart Color as Per Dimension

Hello,

One more help please:

I have simple bar chart Year vs Total Customer. I'm restricting Years for latest 2 years. So it is showing 2017, 2018 Total Customer data.

Now I want to show max(Year) in one color and max(Year)-1 in other. I've added background color in expression and it is working with Year filter selected.

But when I clear all the filters both the bars are of same color. Only this is working when Year filter selected. Screenshots attached.

Can you please help me on this?

Thank You in advance !

Message was edited by: Amruta Joshi

1 Solution

Accepted Solutions
jyothish8807
Master II
Master II

Hi Amruth,

Store max(Year) in a variable and try the same expression.

MaxYear= max(Year)

Background exp: if(Year=$(MaxYear),RGB(192,0,0), RGB(248,203,173))

Pfa

Br,

KC

Best Regards,
KC

View solution in original post

6 Replies
trdandamudi
Master II
Master II

Can you share a sample qvw?

Anil_Babu_Samineni

You can use condition based, then?

If(GetSelectedCount(Year)=0, Your Condition, Your Condition)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
amruta_j
Partner - Contributor III
Partner - Contributor III
Author

Not working ...:(

jyothish8807
Master II
Master II

Hi Amruth,

Store max(Year) in a variable and try the same expression.

MaxYear= max(Year)

Background exp: if(Year=$(MaxYear),RGB(192,0,0), RGB(248,203,173))

Pfa

Br,

KC

Best Regards,
KC
amruta_j
Partner - Contributor III
Partner - Contributor III
Author

thank you..it worked.

But not sure why without variable it was not working.

jyothish8807
Master II
Master II

Since you where using Max(date) for each date in dimension it becomes max date itself, so always the first condition becomes correct and it dosent go to 2nd condition.

Br,

KC

Best Regards,
KC