Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Append Number to Day of Week

Hello All,

My business is very cyclical within each month.  I would like to monitor performance based on the day of the week.  I was able to extract the day of the week using the weekday function.  My next step is to append/prepend a figure 1,2,3,4,5 to represent the weekday of the month.  First Monday = Monday1, Second Monday = Monday2, etc.

Any idea as how to accomplish this?

Thanks,

TJ

3 Replies
swuehl
MVP
MVP

Maybe like

LOAD *,

          WeekDayName & Autonumber(Week(Date), MonthName(Date) ) as NewField;

LOAD

          ... // your calendar code including the WeekDayName and Date field

sunny_talwar

May be like this:

LOAD Date,

          WeekDay(Date) as WeekDay,

          WeekDay(Date) & AutoNumber(RowNo(), WeekDay(Date)&Month(Date)) as WeekDayNum

Resident ....;

swuehl
MVP
MVP

Another option not depending on the order of the dates in the input table would be

LOAD WeekDay(Date) & (Div(Day(Date),7)+1) as Test,

  *;

LOAD Date(MakeDate(2016)+recno()-1) as Date

AutoGenerate 366;