Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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 ]
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 ]