Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

mahitham
Contributor

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

Re: Flag creation help

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 ]
1 Reply
MVP
MVP

Re: Flag creation help

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 ]
Community Browser