Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
mtabernad
Partner - Creator
Partner - Creator

Problem with a color expression

Hi everyone,

I am using this expression as KPI, which is the std deviation of number of connections over the daily average:

(count({$<date_id={"$(=max(date_id))"}>}connect_time) - (count({$<date_id=>}connect_time)/count(distinct {$<date_id=>}date_id)))

/

(count({$<date_id=>}connect_time)/count(distinct {$<date_id=>}date_id))

 

also I built a bar chart to see this deviation by user with the following color expression:

 

if(((count({$<date_id={"$(=max(date_id))"}>}connect_time) (count({$<date_id=>}connect_time)/count(distinct date_id)))
/
(count({$<date_id=>}connect_time)/count(distinct date_id)))<=0.50,Green(),rgb(255,31,31))

 

 

KPI expression and color expression work for maximum date (in my case 31/10/2019)

Capture1.png

 

But if I pick the previous day on the date filter panel (30/10/2019) or other days, KPI expression still works but color expression doesn't:

Capture2.png

 

Could anyone help me?

 

Thank you very much.

Labels (2)
1 Solution

Accepted Solutions
hallquist_nate
Partner - Creator III
Partner - Creator III

Your expression for the KPI is not matching your expression for the color definition.  You are missing sthe set expresions is formula segments as show below in the pic.

Expression Diff.PNG

 

This is always a tricky excercise for me.  I reduce risk by copying and pasting my KPI formula into my If() statement.

Hope this helps,

Nate

View solution in original post

2 Replies
hallquist_nate
Partner - Creator III
Partner - Creator III

Your expression for the KPI is not matching your expression for the color definition.  You are missing sthe set expresions is formula segments as show below in the pic.

Expression Diff.PNG

 

This is always a tricky excercise for me.  I reduce risk by copying and pasting my KPI formula into my If() statement.

Hope this helps,

Nate

mtabernad
Partner - Creator
Partner - Creator
Author

Ohhh! You were sooo right! I don't know why I didn't realize about it. Thank you very much!