Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
angelfer90
Contributor
Contributor

Four Month Periods on Autocalendar Qlik Sense

Hi everybody,

Simple question,

I know I can get year, 3 months periods, year quarter from a date using autocalendar as I show you below.

 

[autoCalendar]:
DECLARE FIELD DEFINITION Tagged ('$date')
FIELDS
Dual(Year($1), YearStart($1)) AS [Year] Tagged ('$axis', '$year'),
Dual('Q'&Num(Ceil(Num(Month($1))/3)),Num(Ceil(NUM(Month($1))/3),00)) AS [Quarter] Tagged ('$quarter', '$cyclic'),
Dual(Year($1)&'-Q'&Num(Ceil(Num(Month($1))/3)),QuarterStart($1)) AS [YearQuarter] Tagged ('$yearquarter','$qualified'),

DERIVE FIELDS FROM FIELDS [tsContact] USING [autoCalendar] ;

 

But I couldn´t achieve a four months periods inside Qlik Sense.

 

Please anyone who knows the exact code to create 4 months periods from a date using autocalender to divide the year in three parts instead of 4.

 

Thank you in advance 

 

Labels (3)
2 Replies
MarcoWedel

If

 

Dual('Q'&Num(Ceil(Num(Month($1))/3)),Num(Ceil(NUM(Month($1))/3),00)) AS [Quarter],

 

delivers quarters,  then something like

 

Dual('F'&Num(Ceil(Num(Month($1))/4)),Num(Ceil(NUM(Month($1))/4),00)) AS [FourMonthPeriod],

 

delivers four month periods, right?

 

MarcoWedel_0-1655398125423.png

 

hope this helps

Marco

angelfer90
Contributor
Contributor
Author

Hi Marco,

Thank you for your reply.

 

I don´t specify that I also try to make the Year-FourMonthPeriod.

 

As you can see here I didn´t achieve it, it takes properly the fourmonthperiod, but for a reason I don´t understand it doesn´t take properly the year. 

 

angelfer90_1-1655714580089.png

 

This is the code I use to try to create the Year_FourMonthPeriod

Dual(Year($1)&'-C'&Num(Ceil(Num(Month($1))/4)),Num(Ceil(NUM(Month($1))/4),00)) AS [YearCuatrimestre] Tagged ('$YearCuatrimestre', '$qualified'),