Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
fashid
Specialist
Specialist

help needed in changing weekstart

I have been provided with an inline table in which every new week starts from Monday and the corresponding date,

I have been told to make the week start from Friday instead of Monday.

I am attaching a qvw file for your reference any help is greatly appreciated i am a new to qlikview and learning slowly

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

Expecting like this?

weekdaytable:

LOAD *,

  if(IsNull(Previous(Date)), 1, if(WeekStart(Previous(Date), 0, 4) = WeekStart(Date, 0, 4), Peek('WeekNo'), Peek('WeekNo') + 1)) AS WeekNo;

Load

   day(Date) as Day,

   Date,

   WeekDay(Date) as weekday,

   RowNo() as count

Resident Input;

View solution in original post

6 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Expecting like this?

weekdaytable:

LOAD *,

  if(IsNull(Previous(Date)), 1, if(WeekStart(Previous(Date), 0, 4) = WeekStart(Date, 0, 4), Peek('WeekNo'), Peek('WeekNo') + 1)) AS WeekNo;

Load

   day(Date) as Day,

   Date,

   WeekDay(Date) as weekday,

   RowNo() as count

Resident Input;

mangalsk
Creator III
Creator III

Hello,

Find attachment its working.

Hope it help you

Find field NewWeekStartDate

jjordaan
Partner - Specialist
Partner - Specialist

Hi Nadeem,

You do this within the script of your Master Calendar

Dual(WeekDay(Field),Mod(WeekDay(Field)+3,7))

fashid
Specialist
Specialist
Author

Actally i dont have master calendar i am told to do this just with the inline table

Thanks for the Input

fashid
Specialist
Specialist
Author

Thanks a lot u nailed it perfectly ... If you could explain me the IF statement that you have used and also why you have not included the from statement in your first load statement

"LOAD *,

  if(IsNull(Previous(Date)), 1, if(WeekStart(Previous(Date), 0, 4) = WeekStart(Date, 0, 4), Peek('WeekNo'), Peek('WeekNo') + 1)) AS WeekNo;"

i would greatly appreciate it..

Thanks & regards,

Nadeem