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?
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) )
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) )
Thank you so much!! It was so simple