Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Month as Bucket

Hi All,

  I am having a month from May 2017,Jun 2017,Jul 2017.....Dec 2021. Here I need to have filter to classify these month values.

Ex:

  +3 Months = From  May 2017 to Jul 2017

  +6 Months = Aug 2017 to Jan 2018

+12 Months = Feb 2018 to Rest

Let me know with your ideas

-Jai

6 Replies
Anonymous
Not applicable
Author

Anonymous
Not applicable
Author

Hi Anil,

   Here my requirement is  based on month filter (+3months,+6Months,+12Months)  my data needs to get changed

Also I dont  have date field here. Based on Month Name (May 2017,Jun 2017....) I need to get filter.

-Jai

Anil_Babu_Samineni

May be look this?

Script:

LOAD Date,If(Date >= '01-05-2017' and Date <= '01-08-2017', Dual('+3 Months',1),

If(Date >= '02-08-2017' and Date <= '02-02-2018', Dual('+6 Months',2),Dual('+12 Months',3))) as Filter;

LOAD Date(MinDate+IterNo()-1) as Date 

While MinDate+IterNo()-1 < MaxDate; 

LOAD MonthStart(Today()) as MinDate, 

     MakeDate(2022) as MaxDate

AutoGenerate 1;

Capture.PNG

Note: Please make sure to create Dynamic Variables for dates and then call them up

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

What about this:

If(Match([your field], 'May 2017', 'Jun 2017', 'Jul 2017', '+3',

     If(Match([your field], 'May 2017', 'Aug 2017', ...., '+6', '+12') as Filter

Anonymous
Not applicable
Author

Hi All,

Here what is the  issue?

if(period<=monthname(AddMonths(today(),2)),'3months', // Giving May  2017 -to Jul  2017

   (IF(period<=monthname(AddMonths(today(),5)) and cal_period>=monthname(AddMonths(today(),0)),'6MONTHS',//Here  I am looking May 2017 to Oct 2017

IF(period<=monthname(AddMonths(today(),18))AND cal_period>monthname(AddMonths(today(),8)),'12MONTHS',// Here I am looking May 2017 to Apr 2018

   'N')))) as Bucket

beck_bakytbek
Master
Master

Hi ij qlik,

look at this issue: Class Function

Beck