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: 
nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II

Need Help on Creating week buckets

Hi all,

I have one requirement creating week buckets on one field.

What exactly i want is I have one field like DOJ.i wanted to create On that field week buckets i.e in one month we have max 4 or 5 weeks it consist like wise i want week buckets for enataire Year and i should show on line chart.Kindly help me on this with your vallid solutions.

Here i m sharing Sample Data also.

Note : I Need Script Level

Its Urgent>>>>>>>>

1 Solution

Accepted Solutions
preminqlik
Specialist II
Specialist II

yeah you can make it further like below

if(match(Day(DOJ),1,2,3,4,5,6,7),'Week1',

if(match(Day(DOJ),8,9,10,11,12,13,14),'Week2',

if(match(Day(DOJ),15,16,17,18,19,20,21),'Week3',

if(if(match(Day(DOJ),22,23,24,25,26,27,28),'Week4','Week5'))) )              as               Week

View solution in original post

7 Replies
preminqlik
Specialist II
Specialist II

hey try this

Load *,

if(match(Day(DOJ),1,2,3,4,5,6,7),'Week1',

if(match(Day(DOJ),8,9,10,11,12,13,14),'Week2',

if(match(Day(DOJ),15,16,17,18,19,20,21),'Week3','Week4')))               as               Week

from Emp.xls

MarcoWedel

Week(DOJ) as Week

Or

WeekName(DOJ) as WeekName

MK_QSL
MVP
MVP

=WeekYear(Today()) &'-'& NUM(Week(Today()) ,'00')

Use DOJ instead of Today()

nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II
Author

Hi Prem,

As per your solution,

Week1>> 1-7,

Week2>> 8-14,

Week3>>14-21,

Week4>> 22-28,

Week5>>   ??


Week5>> 29-31 Should be also there right.

Why because some months consist 30 ans some 31.


Any one help me on this...

preminqlik
Specialist II
Specialist II

yeah you can make it further like below

if(match(Day(DOJ),1,2,3,4,5,6,7),'Week1',

if(match(Day(DOJ),8,9,10,11,12,13,14),'Week2',

if(match(Day(DOJ),15,16,17,18,19,20,21),'Week3',

if(if(match(Day(DOJ),22,23,24,25,26,27,28),'Week4','Week5'))) )              as               Week

nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II
Author

Let me creak  whether its fulfilling my requirement or not ?

nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II
Author

Can we create in Front End ?

Let me know.