Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have data with two date columns (DATE_A, DATE_B).
I need to flag records, which brakes a month (at least one month end between those two dates).
Any ideas?
Hi,
You can use this logic to flag them.
=if(Date2 >= MonthEnd(Date1),1,0)
Regards,
Kaushik Solanki
Could you please explain with more details what you need?
Thanks
Try like:
if(DATE_A - DATE_B >=30, 1, 0) as Flag
From
<Data Source>;
Hi,
You can use this logic to flag them.
=if(Date2 >= MonthEnd(Date1),1,0)
Regards,
Kaushik Solanki
Hi,
Try like this
LOAD
*,
if(Fabs(DATE_A - DATE_B) >=30, 1, 0) as Flag
FROM DataSource;
OR
LOAD
*,
if(MonthName(DATE_A) <> MonthName(DATE_B), 1, 0) as Flag
FROM DataSource;
Hope this helps you.
Regards,
Jagan.
by using the set anlaysis it implemented
Another one could be:
Table:
LOAD *,
If(Floor(MonthEnd(DATE_B)) > Floor(MonthEnd(DATE_A)), 1, 0) as Flag;
LOAD * Inline [
DATE_A, DATE_B
01/20/2016, 01/30/2016
02/12/2016, 03/03/2016
];