# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

New Contributor II

## Adding Multiple Conditions Into an Expression Formula

Hello,

In need of help once again   I am trying to conditionally format one column (Start Date) in multiple ways. One way (which I have an accurate formula for already) is to mark any Charter dates that are 30 days before today's date with a red background and black text.

Here is that formula:

if(getfieldselections([PCI Type])='CHARTER',

if([Plan Start Date]<Today()-30,red(200),black(50)))

I'd like to add a second condition similar to this one, except highlighting dates that are between the current date (Today) and 60 days from now (+60) with a blue background and black text. Earlier, I was able to get an accurate way to COUNT the number of dates with this criteria with this formula:

Count({ < [Plan Start Date] = {">\$(=Today(1))<\$(=Date(Today(1)+60))"}, [PCI Type] = {'CHARTER'}>} [PCI Type])

Here is my attempt at combining the two:

if(getfieldselections([PCI Type])='CHARTER',

if([Plan Start Date]<Today()-30,red(200),black(50),

if({ < [Plan Start Date] = {">\$(=Today(1))<\$(=Date(Today(1)+60))"}},blue(200),black(50))))

What am I missing? Really appreciate any help!

Kyle

3 Replies
MVP

## Re: Adding Multiple Conditions Into an Expression Formula

Are you applying as expression / BG color? Try this

if(getfieldselections([PCI Type])='CHARTER',

if([Plan Start Date]<Today()-30,red(200),black(50),

if({ < [Plan Start Date] = {">\$(=Today(1))<\$(=Date(Today(1)+60))"}},blue(200),black(50))))

New Contributor II

## Re: Adding Multiple Conditions Into an Expression Formula

Hey Anil,

Yes, this is for a Background color expression. Unfortunately, your suggestion to remove the first "black(50)" didn't work. I feel like we're right there!!

Thanks,

Kyle

MVP

## Re: Adding Multiple Conditions Into an Expression Formula

Would you able to share sample?