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

Flag creation help

Hi Experts,

Can any one please help me on below requirement.

I have Three date fields like below. If the System Date is present in between start date and End date then the Flag need to show Yes else no

Input:

Load * Inline [

ID,SystemDate,StartDate,EndDate

14523,01/03/2018,17/08/2018,25/08/2018 

14253,02/04/2018,01/04/2018,05/04/2018

15368,21/05/2018,16/05/2018,24/05/2018

];

Expected Output:

ID              System Date       Start Date       End Date          Flag

14523       01/03/2018        17/08/2018     25/08/2018      No

14253       02/04/2018        01/04/2018     05/04/2018      Yes (Here   02/04/2018 is present in Between 01/04/2018   05/04/2018  )

15368      21/05/2018        16/05/2018     24/05/2018       Yes

 

Please help me on this.

Thanks in advance

 

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try

SET DateFormat='DD/MM/YYYY';

Load *,
	if(SystemDate>= StartDate and SystemDate<=EndDate, 'Yes', 'No') as Flag
Inline [ ID,SystemDate,StartDate,EndDate 14523,01/03/2018,17/08/2018,25/08/2018 14253,02/04/2018,01/04/2018,05/04/2018 15368,21/05/2018,16/05/2018,24/05/2018 ]

View solution in original post

1 Reply
tresesco
MVP
MVP

Try

SET DateFormat='DD/MM/YYYY';

Load *,
	if(SystemDate>= StartDate and SystemDate<=EndDate, 'Yes', 'No') as Flag
Inline [ ID,SystemDate,StartDate,EndDate 14523,01/03/2018,17/08/2018,25/08/2018 14253,02/04/2018,01/04/2018,05/04/2018 15368,21/05/2018,16/05/2018,24/05/2018 ]