Qlik Community

Qlik DataMarket Discussions

Discussion Board for collaboration regarding Qlik DataMarket.

Not applicable

53 Weeks in the Year grouped in periods of 4 weeks

Hello all,

I have a doubt about how group weeks in periods. Lets explain myself: I have grouped the weeks into periods of 4 weeks. ( A year has 13 periods of 4 weeks) The problem comes when I realized that this year, has 53 weeks instead of 52 and the last week, that is the week nº53 has to be included in the period number 13.


The actual formuIa I am using to get the periods of 4 weeks is the next one:


Week(DATETABLE) as Week,

      ceil(Week (DATETABLE)/ 4)as Period,

But with that formula, the week number 53 is included in a 14thperiod and what I want is to included in the 13thperiod.

Could someone help me with this?

Many thanks!

Tags (1)
1 Solution

Accepted Solutions
lironbaram
Honored Contributor II

Re: 53 Weeks in the Year grouped in periods of 4 weeks

hi

you can try this

rangemin(ceil(Week (DATETABLE)/ 4),13)as Period,

2 Replies
lironbaram
Honored Contributor II

Re: 53 Weeks in the Year grouped in periods of 4 weeks

hi

you can try this

rangemin(ceil(Week (DATETABLE)/ 4),13)as Period,

Not applicable

Re: 53 Weeks in the Year grouped in periods of 4 weeks

Thank you so much! It seems to work!

Community Browser