Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
manojkulkarni
Partner - Specialist II
Partner - Specialist II

Week Calculation

Hi Friends,

I am working on making some weekly report where in i have to consider Saturday as Weekstart & Friday as weekend for calculation. I am trying by setting FirstWeekDay in Script. But i am not able to the required result. Please advise

15 Replies
manojkulkarni
Partner - Specialist II
Partner - Specialist II
Author

=(WeekStart(Today())) is returning 21-08-2017 where as Saturday is 19-08-2017

Anil_Babu_Samineni

Try this in your environment

SET DayNames='Sat;Sun;Mon;Tue;Wed;Thu;Fri';

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
prma7799
Master III
Master III

Hi Manoj ,

Your script is ok.

Instead of this WeekStart(Today()) try this function WeekDay(WeekStart(Today()))



week.png

qlikviewwizard
Master II
Master II

This is working for me:

=WeekDay(WeekStart(Today()))

=WeekDay(WeekEnd(Today()))

manojkulkarni
Partner - Specialist II
Partner - Specialist II
Author

I agree, by using weekday() function it is returning the value. But i would need the weekstart & end dates for my calculation.

chris_johnson
Creator III
Creator III

If I'm reading it right you may just need to change the line of script where it says:

SET FirstWeekDay=0;


to


SET FirstWeekDay=5;