Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
pradeep92
Partner - Creator II
Partner - 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
Durgadevikumar
Partner - Contributor III
Partner - Contributor III

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

pradeep92
Partner - Creator II
Partner - Creator II
Author

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 

Kushal_Chawda

You can find it in appearance 

Capture.JPG

pradeep92
Partner - Creator II
Partner - Creator II
Author

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

SerhanKaraer
Creator III
Creator 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.