Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Date greater than IF statement

Hi All,

I need to select data based on ServiceDate less than CheckinDate so I am trying to have a listbox with expression

IF(ServiceDate<CheckinDate,'Y','N'). However, that is not doing the right selection.

Below is how I have the script in the SQL:

cast(ServiceDateTime as date) as ServiceDate,

cast(CheckinDate as date) as CheckinDate

Then on the chart properties-Number, I am selecting "M/D/YYYY".

Could someone please help so that I can select the data where ServiceDate>CheckinDate?

Thank you.

14 Replies
Anonymous
Not applicable
Author

No worries Sunny. I will just export the data in Excel and manually do it in Excel. I am getting off.

Thanks much for your time again.

sunny_talwar

Yes, I know it would be a problem.... only way would be to join the two tables in the script to create a flag field

Anonymous
Not applicable
Author

‌Is there anything that is common between the fields like a room id and are the service dates fixed or do they vary like the check in date?

Anonymous
Not applicable
Author

Yes. VisitID is common between the two tables. ChecinDate is fixed per visit. However, service date can be several different one depending on when an amount was paid. Btw, I need amounts that were paid with service date prior to check in so I am about to update my original question. I have figured it out in Excel though. Thank you.

Anonymous
Not applicable
Author

Did you update your question? It sounds like something I have worked on in the past and I may be able to provide some info.