Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

gauravkhare
Contributor

calculating last 30, 60, 90 days from a date field in qliksense

Hello Experts,

I need to calculate 30, 60, 90, past year etc from a date field and then to provide the outcome in the form of filters. Kindly provide solution

Thanks in advance

Gaurav

2 Replies
gauravkhare
Contributor

Re: calculating last 30, 60, 90 days from a date field in qliksense

To be more precise the requirement is to take a filter having values like Prior Month, last 30 days, last 60 days, last year etc. when user selects for last 30 days from the filter than the chart should change accordingly

Kindly help

Re: calculating last 30, 60, 90 days from a date field in qliksense

May be create flags in the script and use a link table:

LinkTable:

LOAD Date,

          'Last 30 Days' as Flag

Resident MasterCalendar

Where Date >= Today() - 30;

Concatenate (LinkTable)

LOAD Date,

          'Last 60 Days' as Flag

Resident MasterCalendar

Where Date >= Today() - 60;

Concatenate (LinkTable)

LOAD Date,

          'Last 90 Days' as Flag

Resident MasterCalendar

Where Date >= Today() - 90;

Concatenate (LinkTable)

LOAD Date,

          'Last 1 Year' as Flag

Resident MasterCalendar

Where Date >= AddYears(Today(), -1);

And then you can use Flag as your filter to select Last 30 Days or Last 1 Year

Community Browser