Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
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
Not applicable

Re: Append Number to Day of Week

Maybe like

LOAD *,

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

LOAD

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

sunny_talwar
Not applicable

Re: Append Number to Day of Week

May be like this:

LOAD Date,

          WeekDay(Date) as WeekDay,

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

Resident ....;

swuehl
Not applicable

Re: Append Number to Day of Week

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;