Do something similar, payperiod to day; which is easier because its a fixed interval.
So, my adjusted untested code would be:
Date#(BudgetStartDate) + Iterno() AS "Date",
ROUND("BudgetHours"/Day(MonthEnd(BudgetStartDate)),.01) AS "BudgetHours"
WHILE IterNo() <= Day(MonthEnd(BudgetStartDate));
I have not written a load script with that kind of logic before but conceptually I think it is a great idea. I will try to implement your solution and let you know how it goes. As with all your replies, this information is very helpful. Thanks for taking the time to help me figure this out!
I was originally thinking of a master calendar but that requires thousands of lines and must be maintained so I immediately loose the challenge.
Calendars in Qlikview are relatively simple to create, I have attached a simple solution for you to review.
For ease of maintenance for my Calendar Scripts I write them to a QVS file as subs then in my applications 'Call' them in my load scripts as reusable code.
(my calendar scripts accept a year and generate the start and end dates from them)
This way if I modify the qvs and the changes are applied to all of my apps on the next reload. There are many examples of Calendar code if you search that you can use
SimpleCalendar.qvw 163.8 K