Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
salleninsd
Creator
Creator

If Statement for Background Color

Hello,

I am trying to have a background color based on an If statement, and I cannot seem to get the syntax right.  I have done a number of iterations on the following formula, and even when it says OK, it is not showing up in the background.  Wondering if anyone can see if I am missing components in my calculation (i.e. $, ', etc.)?  Each of the expressions, independently, work.  Here is the expression:

if(

sum({<[DimDateSOC.CalendarYear]={2018},[DimDateSOC.MonthOfYear]={1,2,3,4,5,6,7,8,9,10}>} [Episode.IsAdmit])

>=

sum({<[DimDateSOC.CalendarYear]={2017},[DimDateSOC.MonthOfYear]={1,2,3,4,5,6,7,8,9,10}>} [Episode.IsAdmit])

,RGB(Green),RGB(Red))

Thank you in advance for your help!

1 Solution

Accepted Solutions
MohammedMustaq
Partner - Creator
Partner - Creator

Try This

if(

sum({<[DimDateSOC.CalendarYear]={2018},[DimDateSOC.MonthOfYear]={1,2,3,4,5,6,7,8,9,10}>} [Episode.IsAdmit])

>=

sum({<[DimDateSOC.CalendarYear]={2017},[DimDateSOC.MonthOfYear]={1,2,3,4,5,6,7,8,9,10}>} [Episode.IsAdmit])

,Green(),Red())

View solution in original post

2 Replies
MohammedMustaq
Partner - Creator
Partner - Creator

Try This

if(

sum({<[DimDateSOC.CalendarYear]={2018},[DimDateSOC.MonthOfYear]={1,2,3,4,5,6,7,8,9,10}>} [Episode.IsAdmit])

>=

sum({<[DimDateSOC.CalendarYear]={2017},[DimDateSOC.MonthOfYear]={1,2,3,4,5,6,7,8,9,10}>} [Episode.IsAdmit])

,Green(),Red())

salleninsd
Creator
Creator
Author

Woo Hoo!  Thanks for your help Mohammed!!!  It works!