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.

Do More with Qlik - for Beginners and Beyond, Topic: Qlik Replicate on January 21, 2PM EST. REGISTER NOW
Showing results for 
Search instead for 
Did you mean: 

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 







1 Reply

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