Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have requirement, i want to show month wise week number w1,w2,w3,w4,w5
It should be start with Week 1, Week 2... and so on
please see this also..Date Functions
without using any macro....
Example:
Feb Month 2016
| Monday | Tuesday | Wednesday | Thursday | Fryday | Saturday | Sunday | ||
25 | 26 | 27 | 28 | 29 | 30 | 31 | (Jan) | |
| 01 | 02 | 03 | 04 | 05 | 06 | 07 | Week number 1 | |
| 08 | 09 | 10 | 11 | 12 | 13 | 14 | Week number 2 | |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 | Week number 3 | |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 | Week number 4 | |
| 29 | Week number 5 |
Any suggestions ?
Presuming that having two week 4's is a typo and borrowing the answer from this question:
Try
if((week(Date) - week(monthstart(Date)) + 1)<1,1,(week(Date) - week(monthstart(Date)) + 1)) as WeekNumberInMonth,
Props to philmywallet for the work!
Presuming that having two week 4's is a typo and borrowing the answer from this question:
Try
if((week(Date) - week(monthstart(Date)) + 1)<1,1,(week(Date) - week(monthstart(Date)) + 1)) as WeekNumberInMonth,
Props to philmywallet for the work!
i found in Community..
i have used this code...
if(month(weekend(data))= month(data),div(day(WeekEnd(data)),7),div(day(Weekend(data,-1)),7)+1)+1 as WeekNumber,
But Feb, 2016 it showing start with Week2,week3,week4 and so on.
My requirement it should start with Week1......
Take Month(DATE) as Month, Weekday(DATE) as Weekday in script... and in report take Month and weekday field as dimension and count(DATE) as expression in chart ...then the report will show the output you want
May be you can try the below script
LOAD *, If(Month(Date) = Month(Previous(Date)), if(Week(Date)=Week(Previous(Date)), Peek('WeekNo'), Peek('WeekNo') + 1), 1) AS WeekNo
Resident Calendar;