Discussion Board for collaboration related to QlikView App Development.
I'm trying to do a master calendar with a "payment period", similar to a fiscal year, but in months.
What I need to do is:
21/03/2014 to 20/04/2014 is Month 04/April
21/04/2014 to 20/05/2014 is month 05/May
and so on...
How can I do it?
I've try that doing a sum to the month... but didn't get what I expected.
LET vDateMin = 45000;//&Num(Peek('Start_Date_AP', 0, 'AP_Link_Table'));
LET vDateMax = 50000;//Num(Peek('End_Date_AP', -1, 'AP_Link_Table'));
LET vDateToday = Num(Today());
$(vDateMin) + RowNo() - 1 AS Date_Key,
Date($(vDateMin) + RowNo() - 1) AS Date
WHILE $(vDateMin)+IterNo()-1<= $(vDateMax);
,MonthName(Date) as MonthName
,WeekDay(Date) as WeekDay
,month(Date+1) as MesEPSuma
DROP Table TempCalendar1;
But that way has trouble when the month is "12"
Finally I solved it with:
,WeekDay(Date) as DiaSemana
View solution in original post
There are errors in your IF logic, replace your if with something like
if(Day(Date)>$(vDiaEP) and month(Date)<12, month(Date)+1, month(Date) as MesEP
month(Date)+1 as MesEPSuma
The plus 1 goes outside the brackets...