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

Announcements
Maximize ROI with Qlik Professional Services – Expert Guidance, Faster Results: Explore Qlik Services
cancel
Showing results for 
Search instead for 
Did you mean: 
narayanaqlik
Creator
Creator

Convert the dates into buckets like ,30 days, >30 days to< 60 Days, >60 days to < 90 days and >90

Hi all, 

Please tell me the solution for OrderDate need to convert into Convert the dates into buckets like ,30 days, >30 days to< 60 Days, >60 days to < 90 days and >90  days from today 

OderDate format is DD-MM-YYYY hh:mm:ss  ffff tt

Kindly suggest me where can i create the buckets of days in dimension or script and please provide me the logic

and  OrderDate has contain 2001 to 2031 years of dates but in need to implement it should display based on current date if we select any date then it should select based on the selected date.

 

1 Reply
premvihari
Partner - Creator
Partner - Creator

Hi @narayanaqlik ,

You can use the below 

Load 

if((today()-orderdate)>0 and  (today()-orderdate)<=30, '0-30 days',
      if((today()-orderdate)>30 and today()-orderdate)<=60 , '30-60 days',
              if((today()-orderdate)>60 and today()-orderdate)<=90 , '60-90 days',
                  if(today()-orderdate)>=90,'90+ days')))) as orderdatebucket,
*

resident of table where orderdate >= today();