Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
PatChaney
Contributor
Contributor

Conditional Date Selection

Hi, new to Qlik Sense and wondering if anyone can help.

I have a select date range function and  would like to make the date field used conditional on the value of another field. So if Field A = 'PAID' use Date Field 1, otherwise use Date Field 2. Tried all combinations of the IF function and can't get it to work.

Any suggestions would be appreciated.

Labels (1)
2 Replies
Spivey
Partner - Contributor III
Partner - Contributor III

Technically all you'd need to use is something like:

 

=if([someField]= 'PAID', [DateABC], [DateXYZ])

 

 Just make sure you aren't trying to show dates that are not distinct for the dimensions you're using.

Here's a table where [OrderID] has only one possible [DateABC] for each record:

OrderIDStatusDateABC
A016PAID3/21/2019
F073OVERDUE2/9/2019
K108PAID9/2/2020

 

But here's that table where [OrderID] is removed -- the [Status] dimension can have multiple [DateABC] values for each record and so the [DateABC] shows NULLs:

StatusDateABC
PAID-
OVERDUE-

 

PatChaney
Contributor
Contributor
Author

Thanks very much for your reply, I thought I had tried that but will try again as per your example.