Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
Partner
Partner

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
Honored Contributor II

Re: Bar Chart Color as Per Dimension

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
Honored Contributor II

Re: Bar Chart Color as Per Dimension

Can you share a sample qvw?

Re: Bar Chart Color as Per Dimension

You can use condition based, then?

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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Partner
Partner

Re: Bar Chart Color as Per Dimension

Not working ...:(

jyothish8807
Honored Contributor II

Re: Bar Chart Color as Per Dimension

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

Partner
Partner

Re: Bar Chart Color as Per Dimension

thank you..it worked.

But not sure why without variable it was not working.

jyothish8807
Honored Contributor II

Re: Bar Chart Color as Per Dimension

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