Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I have to create customised week i.e from first month of the day to 7th day it should be week one
1-july-2016 - 7 july 2016 : Week 1
8-july-2016 - 14 july 2016 : Week 2
15-july-2016 - 21 july 2016 : Week 3
22-july-2016 - 31july 2016 : All the remaining day
This I have to do for all the months of the year in load script.
Can someone suggest how should I go ahead.?
Shweta
hi u can try this here i am using calendar_date from master calendar , i am sure u have also created master calendar in your script.
Load this in your load script.
IF(num(Left(Calendar_Date,2))<=7,'week1',
IF(num(Left(Calendar_Date,2))>=8 And num(Left(Calendar_Date,2))<=14,'week2',
IF(num(Left(Calendar_Date,2))>=15 And num(Left(Calendar_Date,2))<=21,'week3',
IF(num(Left(Calendar_Date,2))>=21 ,'rest of the day')))) As Monthly_week_Bucket_Master,
have you tried
week(date field) as week
hi u can try this here i am using calendar_date from master calendar , i am sure u have also created master calendar in your script.
Load this in your load script.
IF(num(Left(Calendar_Date,2))<=7,'week1',
IF(num(Left(Calendar_Date,2))>=8 And num(Left(Calendar_Date,2))<=14,'week2',
IF(num(Left(Calendar_Date,2))>=15 And num(Left(Calendar_Date,2))<=21,'week3',
IF(num(Left(Calendar_Date,2))>=21 ,'rest of the day')))) As Monthly_week_Bucket_Master,
What about this:
if(day(Date) <= 7, 'Week 1',
if(day(Date) <= 14, 'Week 2',
if(day(Date) <= 21, 'Week 3', 'Week 4'))) as [Week of the month]
this is also a way to create week.
thanks
Hi Ankit,
Thanks a lot for your reply. It just fit into my situation well.
(Missed to revert Sorry )