Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to load all the months prior to this month for the calendar year. I have written the following logic but i am not getting the desied result. Example, current month is November. So, i will have to load all the previous months from Jan to Oct.
Let vDateToday = Num(today());
Let TotalMonths= (Num(Month($(vDateToday))) -1);
for i = 1 to $(TotalMonths)
Load Text(Month(MakeDate(Year($(vDateToday)),($(i))))) as CalendarMonthsCompleted;
next i ;
Please help
Also this script is just loading only one value which is Jan
Are you trying to create a table which only include 1 month less than current month? May be like this
Table:
LOAD Month(AddMonths(YearStart(Today()), IterNo()) as CalendarMonthsCompleted
AutoGenerate 1
While IterNo() < Num(Month(Today());
Exactly Sunny. I tried your logic. But it takes from Feb because of Iterno() starting from 1
the requirement is to exclude the current month and include all the months prior to it. That is from Jan to Oct
my bad... try this
Table:
LOAD Month(AddMonths(YearStart(Today()), IterNo() - 1) as CalendarMonthsCompleted
AutoGenerate 1
While IterNo() < Num(Month(Today());
Thanks Sunny. That worked
Hi,
one solution might be also:
LOAD Month(Date#(RecNo(),'M')) as Month
AutoGenerate Month(Today())-1;
hope this helps
regards
Marco