Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
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 .