Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
reshmakala
Creator III
Creator III

Week Start from 1st day of the month

Hello all,

I need to get the start date of a week. My week need to start from Sun to Sat. And when I tried using WeekStart function of QlikView, if the first day of the month starts from the middle of the week, I get the weekstart date from previous month.

How can I start my WeekStart dates from first day of the month?

Example:

For October 2014, I get the weekstart output as

09/28/2014

10/05/2014

10/12/2014

10/19/2014...

I want my output as :

10/01/2014  --------> Always my first week of the month should be first of that month.

10/05/2014

10/12/2014

10/19/2014...

How can I get this? Can anyone please help me?

1 Solution

Accepted Solutions
JonnyPoole
Employee
Employee

I think you want the month start when the week begins in the previous month.

You could try this to capture that condition:

if(   Month(WeekStart(Date)) = Month(Date) , WeekStart(Date),  MonthStart(Date) )

View solution in original post

2 Replies
JonnyPoole
Employee
Employee

I think you want the month start when the week begins in the previous month.

You could try this to capture that condition:

if(   Month(WeekStart(Date)) = Month(Date) , WeekStart(Date),  MonthStart(Date) )

reshmakala
Creator III
Creator III
Author

Thank you so much!! It was so simple