Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
sims
Contributor II
Contributor II

How to create a conditional KPI to change the colors

Hi Everyone 

I want help and thanks in advance 

I have data which shows customers balances in a table below. I want to create a conditional KPI which change colors by checking if sum(balance) current is greater or less than the previous sum(balance) instance.

IDDate&Time Balance
MN0012019-12-14 18:15:32.4967333 +02:0020
MN0022019-12-14 18:15:32.4967333 +02:0015
MN0032019-12-16 09:28:09.3790911 +02:0060
MN0042019-12-16 14:16:36.2906864 +02:0010
MN0052019-12-16 15:33:47.1230789 +02:0098
MN0062019-12-17 15:58:04.0504066 +02:00200
MN0072019-12-17 18:21:00.4941654 +02:00600
MN0082019-12-17 18:21:00.4941654 +02:00800
MN0092019-12-17 20:26:02.7718598 +02:00700
MN0102019-12-18 07:43:45.7908600 +02:005
MN0112019-12-18 20:28:36.4884641 +02:00360
MN0122019-12-18 20:28:36.4884641 +02:00450
MN0132019-12-19 07:23:50.5477063 +02:0010
MN0142019-12-19 17:12:30.7128309 +02:00978
3 Replies
martinpohl
Partner - Master
Partner - Master

the colour you can define is depending on the expression (balance) not on the compare of a second expression (balance-prev. balance)

Maybe a table chart with indicator helps?

Regards

sims
Contributor II
Contributor II
Author

Yes I know. They are two colors involved red and green. So if the current balance is greater than the previous the it should be green else red. Remember the balance can increase or decrease.

abhijitnalekar
Specialist II
Specialist II

Hi @sims ,

Are you looking for something like this?

abhijitnalekar_0-1635443951612.png

Create new filed at script level as  previous(Balance) as PrevBalance

and use below formula in the column property background color expression 

if(Balance>PrevBalance,green(),red())

 

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!