Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
Anil_Babu_Samineni

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))))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

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

Anil_Babu_Samineni

Would you able to share sample?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful