Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
solomon_musayev
New Contributor III

6 Month forward from the Selected Date

Hello,

I need help in solving the following issue I am having.

I have a table with the following fields.

ID -  User ID  

StartDate (The date of the first visit)

StartMonthYear (The month and year of the first visit)

VisitDate (Date of any visits that have occurred)

VisitMonthYear (Month and Year if the visit)

I need to create a flag, that will flag all the visits that have occurred in the 6 month post StartDate

For example if a client first visit was on Jan 1st 2016, and he comes on the 1st of the month every month.  The flag will have the all the fields that are associated with his visits for the next 6 month which includes Jan 1st through June 1st 2016.

Please help.

Thank you,

Tags (1)
1 Solution

Accepted Solutions
dan_sullivan
Contributor II

Re: 6 Month forward from the Selected Date

This really depends on how your data model looks.  But in general you can do something like:

IF(VisitDate <= AddMonths(StartDate,6),1,0)

If you dates are stored vertical (in rows) it will be more complicated because you will need to find the start date for each individual ID and then compare that to the visit dates.

1 Reply
dan_sullivan
Contributor II

Re: 6 Month forward from the Selected Date

This really depends on how your data model looks.  But in general you can do something like:

IF(VisitDate <= AddMonths(StartDate,6),1,0)

If you dates are stored vertical (in rows) it will be more complicated because you will need to find the start date for each individual ID and then compare that to the visit dates.

Community Browser