Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
arsenal1983
Creator
Creator

Month end between

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?

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

You can use this logic to flag them.

=if(Date2 >= MonthEnd(Date1),1,0)

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

6 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Could you please explain with more details what you need?

Thanks

senpradip007
Specialist III
Specialist III

Try like:

if(DATE_A - DATE_B >=30, 1, 0) as Flag

From

<Data Source>;

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

You can use this logic to flag them.

=if(Date2 >= MonthEnd(Date1),1,0)

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
jagan
Luminary Alumni
Luminary Alumni

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.

Anonymous
Not applicable

by using the set anlaysis it implemented

sunny_talwar

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

];


Capture.PNG