Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
vishalgoud
Creator III
Creator III

issue with weekstart...??

Hi All,

am deriving weekstart for my project and it is not coming as required.

my requirement is when we select any month then weekstart has to display the Mondays in that Month, but am getting monday from previous month as well....

please look into the below image :

please send your thoughts on how we can avoid getting Monday(weekstart) from previous months...??

just in a normal calender am using weekstart(DATE) as weekstart.

Thanks in advance.

1 Solution

Accepted Solutions
vishalgoud
Creator III
Creator III
Author

Thanks Tresesco.

Its worked for me. just a small change. replaced 0 instead of 1 as we know 1 give tuesday.

If( num(weekday(DATE))=0, DATE) as WeekStart            //Mondays

View solution in original post

3 Replies
tresesco
MVP
MVP

Try like:

If( num(weekday(DATE))=1, DATE) as WeekStart            //Mondays

qlikviewwizard
Master II
Master II

Hi,

You can achieve like this. Please check this.

Data:

LOAD * ,DATE(WeekStart(New_Date_Field),'D/M/YYYY') as WeekStart,Month(New_Date_Field) as Month,Year(New_Date_Field) as Year;

LOAD *,DATE(DATE#(Date_Field,'D/M/YYYY'),'D/M/YYYY') as New_Date_Field INLINE [

Date_Field

01/03/2016

02/03/2016

03/03/2016

04/03/2016

05/03/2016

06/03/2016

07/03/2016

08/03/2016

09/03/2016

10/03/2016

11/03/2016

12/03/2016

13/03/2016

14/03/2016

15/03/2016

16/03/2016

17/03/2016

18/03/2016

19/03/2016

20/03/2016

21/03/2016

22/03/2016

23/03/2016

24/03/2016

25/03/2016

26/03/2016

27/03/2016

28/03/2016

29/03/2016

30/03/2016

31/03/2016

01/04/2016

02/04/2016

03/04/2016

04/04/2016

05/04/2016

06/04/2016

07/04/2016

08/04/2016

09/04/2016

10/04/2016

11/04/2016

12/04/2016

13/04/2016

14/04/2016

15/04/2016

16/04/2016

17/04/2016

18/04/2016

19/04/2016

20/04/2016

21/04/2016

22/04/2016

23/04/2016

24/04/2016

25/04/2016

26/04/2016

27/04/2016

28/04/2016

29/04/2016

30/04/2016

01/05/2016

02/05/2016

03/05/2016

04/05/2016

05/05/2016

06/05/2016

07/05/2016

08/05/2016

09/05/2016

10/05/2016

11/05/2016

12/05/2016

13/05/2016

14/05/2016

15/05/2016

16/05/2016

17/05/2016

18/05/2016

19/05/2016

20/05/2016

21/05/2016

22/05/2016

23/05/2016

24/05/2016

25/05/2016

26/05/2016

27/05/2016

28/05/2016

29/05/2016

30/05/2016

31/05/2016

01/06/2016

02/06/2016

03/06/2016

04/06/2016

05/06/2016

06/06/2016

07/06/2016

08/06/2016

09/06/2016

10/06/2016

11/06/2016

12/06/2016

13/06/2016

14/06/2016

15/06/2016

16/06/2016

];


Capture.PNG

vishalgoud
Creator III
Creator III
Author

Thanks Tresesco.

Its worked for me. just a small change. replaced 0 instead of 1 as we know 1 give tuesday.

If( num(weekday(DATE))=0, DATE) as WeekStart            //Mondays