Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all, i need your expertice help.
It's possible to obtain the week numbers grouping by month from a date?
For example, today() is Month=10
I need to obtain one table with:
Week39
Week40
Week41
Week42
Week43
Week44
Is This possible?
Thanks in advenced!!
May be something like this:
Table:
LOAD Date(MonthStart(Today()) + IterNo() - 1) as Date,
Week(MonthStart(Today()) + IterNo() - 1) as WeekNum
AutoGenerate 1
While IterNo() <= (Floor(MonthEnd(Today())) - Floor(MonthStart(Today())) + 1);
Update: Fixed the order of MonthEnd and MonthStart in the while statement
So you want to know all the weeks that come in the month of October? Is that the goal? In the script?
yep, but the source is today()
May be something like this:
Table:
LOAD Date(MonthStart(Today()) + IterNo() - 1) as Date,
Week(MonthStart(Today()) + IterNo() - 1) as WeekNum
AutoGenerate 1
While IterNo() <= (Floor(MonthEnd(Today())) - Floor(MonthStart(Today())) + 1);
Update: Fixed the order of MonthEnd and MonthStart in the while statement
Thanks Sunny , but does not work, return 0 Rows
Sorry, I just updated my code:
Table:
LOAD Date(MonthStart(Today()) + IterNo() - 1) as Date,
Week(MonthStart(Today()) + IterNo() - 1) as WeekNum
AutoGenerate 1
While IterNo() <= (Floor(MonthEnd(Today())) - Floor(MonthStart(Today())) + 1);
yeeeeeeeeeah!! you are the best!!
Many thanks!!! Works perfectly!!
hi francisco,
you can get a particular week number between two different dates or you can take the current week number for this year,
i have added for current year.
here's the solution
=ceil((Today()-'01/01/2016')/7)
hope this helps
Thanks Simon, the Sunny answer resolved mi issue