Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Welcome to our newly redesigned Qlik Community! Read our blog to learn about all the new updates: READ BLOG and REPORTED ISSUES
cancel
Showing results for 
Search instead for 
Did you mean: 
Partner
Partner

Qlik Sense custom field in script using dates between today and future

Hello ,

I have a date field and on top of it i am expecting to have custom field to filter my data with specifics such as 'next 4 weeks' ,'next 8 weeks', beyond 8 weeks'. This is an additional field i want to use on filter pane.

In the script i have created below if statement 

if(Date(Date#([Date], 'MM/DD/YYYY') ,'MM/DD/YYYY') > weekstart(today()) and Date(Date#([Date], 'MM/DD/YYYY') ,'MM/DD/YYYY')< weekstart(addmonths(weekstart(today()),1)),'Next 4 Weeks',
IF(Date(Date#([Date], 'MM/DD/YYYY') ,'MM/DD/YYYY') > weekstart(today()) and Date(Date#([Date], 'MM/DD/YYYY') ,'MM/DD/YYYY')< weekstart(addmonths(weekstart(today()),2)), 'Next 8 Weeks',
IF(Date(Date#([Date], 'MM/DD/YYYY') ,'MM/DD/YYYY') > weekstart(addmonths(weekstart(today()),2)),'Beyond 2-Month',Date(Date)))) as Time_Series

after loading the data ,when i select 'Next 4 Weeks' date values seems to be fine and when 'Next 8 Weeks' is selected i am only getting dates beyond 'Next 4 Weeks'  date values ?

how do i change above statement to get proper dates for each filter pane user selection ?

Thanks in advance 

-Srikanth

 

 

 

 

 

1 Reply
Partner
Partner

any help is appreciated .. I am looking for field which i can filter date between few periods. My if statement used is mentioned above .