Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
amala2020
Contributor II
Contributor II

Defining Time Period Filter

Hi Team,

I am very new to Qlik.

I need to create a time filter as mentioned below considering today as max date( 16-12-2021).

 From 23-April 2021 to Till Last month( 11-2021)  As 'Start Date to Last_Month'

From 23-April 2021 to Till Last Quarter( 9-2021)  As 'Start Date to Last_Quarter'

From 23-April 2021 to Till Last Week( 19-12-2021)  As 'Start Date to Last_Week'

 

I have tried like below, but it is not working.

  if( [Master PUBLISHED DATE]>= Date(Date#(20211216,'YYYYMMDD'),'DD-MM-YYYY')

     and [Master PUBLISHED DATE]<=date#(AddMonths(vMaxDate,-1)),'Prog. Start-Monthly',

         if( [Master PUBLISHED DATE]>= Date(Date#(20211216,'YYYYMMDD'),'DD-MM-YYYY')

             and [Master PUBLISHED DATE]<=DATE(AddMonths(vMaxDate,-3)),'Prog. Start-Quarterly',

                           if( [Master PUBLISHED DATE]>= Date(Date#(20211216,'YYYYMMDD'),'DD-MM-YYYY')

                             and [Master PUBLISHED DATE]<=Date#(vMaxDate - 7),'Prog. Start-Weekly'

         )       )       ) as Time_Period

 

 

Can any one help me as this is little urgent

1 Reply
Chanty4u
MVP
MVP

Hi 

what is the error you are getting?

first thing  master publish date is in which format? 

and vmaxdate - what is the result it is showing? 

and try  with one if condition first and check  if it is working then add second .

like that you can debug the issue