Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I copy the this KPI from QS example , i dont know how to make the % change to red color when % is +ve ? Now it display black color , i need to make it display Red color when -ve. Now alway black.
I have try use the below expression , i insert at color value :-
=if([Sales vs Target] <0% ,'#d01919','#545352')
But it does not work.
Paul
As mentioned above, you haven't included the *-1 in the colour expression to finish of the simulation.
The colour expression evaluates separately from your main expression and is therefore still calculating a positive number.
I've just tested it and works perfectly for me.
Example for colour expression:
if(-1*if(
(
Sum({$<year = {$(=Max(year)-0)}, month = {"<=$(=Max({<year={$(=Max(year))}, sales = {'*'}>} month))"}>}sales/1000/Rate)
/
Sum({$<year = {$(=Max(year)-0)}, month = {"<=$(=Max({<year={$(=Max(year))}, sales = {'*'}>} month))"}>}sales_target/1000/Rate)
)
>1,1,
(
Sum({$<year = {$(=Max(year)-0)}, month = {"<=$(=Max({<year={$(=Max(year))}, sales = {'*'}>} month))"}>}sales/1000/Rate)
/
Sum({$<year = {$(=Max(year)-0)}, month = {"<=$(=Max({<year={$(=Max(year))}, sales = {'*'}>} month))"}>}sales_target/1000/Rate)
)
) >0 ,'#d01919','#545352')
My qvf
Hi Paul,
The app is showing invalid visualisation (the visualisation was not found on the server: qsSimpleKPI).
Hi Paul,
you can change ur expression to the below expression:
=if([Sales vs Target] <0 ,RGB(255,0,0),RGB(0,255,0))
Note:
Change the RGB values according to the colour u want
Hi Karupreet
thank you for your reply , I will try this evening.
DOes it mean that QLIK VIEW script for Color expression is not same as KPI Sample ? Need to follow KPI Sample style of writing ?
PAul
HI Nhu
KPI Simpel is qlik sense extension.
in order to remove the error , you need to install KPI SIMPLE EXTENSION to your QS DESKTOP .
NEed to to downlod from qlik branch .
thank you for your help
paul
Hi Paul,
What exactly is ur requirement ? you want to make the text colour change or the bar/ line colours?
If you want to the chnege the text colours then u need to write the same expression in
Right Cick -> Properties -> Font -> Colour -> Calculated Expression
and if you want to change the bar colour then
Right Cick -> Properties -> Expression -> Add your expression -> You will find a plus sign on the expression name, click on that -> colour -> paste the above expression
Regards
Karunpreet
Hi Karunpreet
Base on your reply , I think you refer qlik view right ?
Paul
Sent from my iPhone
Yeah. But u can write the same expression in QlikSenseas well
I am refer to KPI EXTENSION for qlik view
Sent from my iPhone