Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

Change in Target Color based on Budget in Line Chart

Hello ,

Please find the code below.

Load * Inline [
KPI,Target,Budget,Quarter
Sales KPI,80,75,Q1
Sales KPI,80,78,Q2
Sales KPI,72,85,Q3
Sales KPI,78,80,Q4
];

 

I am trying to implement a line chart where the Budget (1st Measure ) should be blue always and the Target(2nd Measure)should be green if Budget is less than Target and Red if Budget is more than Target.

I am getting this kind of Chart below and unable to fullfill the requirement.

Target vs Budget.PNG

 

 

 

Please help me out on this,

 

Regards,

Pradeep

6 Replies
Highlighted
Partner
Partner

Hi,

Good Day😊

Do not  change the background color of the budget. Change color only for the target expression,

Provide the below code in background color expression tab of the target expression

= if(Budget<Target, Green(), Red())

And the color is changed as per your requirement.

Regards,

DurgadeviKumar

Highlighted
Creator II
Creator II

Hi,

Thank you for your response.

We are unable to find that option in Qliksense to change only the specific measure based on expression 

= if(Budget<Target, Green(), Red()).

Please provide us the screenshot on the same.

Thanks,

Pradeep 

Highlighted
MVP
MVP

You can find it in appearance 

Capture.JPG

Highlighted
Creator II
Creator II

Hi Bro,

Thank you for the response.

I tried using the same, but the changes are happening for both the measures. I need the Budget in Blue and Target based on Calculation.

Regards,

Pradeep

Exp.PNG

Highlighted
Contributor III
Contributor III

Hi Pradeep,

If possible, you should define Budget and Target as dimensions in the script.

Then you can specify Budget as blue and Target as calculated color in the "colors and legend" expression.

The idea is to be able to filter the records while colorizing the line.