7 Replies Latest reply: May 9, 2014 6:51 AM by Miikka Koskinen

# Calculate Daily Budget From Monthly Totals

I have the following table loaded in my script:

SourceID,
BudgetID,
FiscalYearID,
AccountID,
PeriodEndDateTime,
AccountClass,
AccountClassType,
AccountControlAccount,
AccountControlCode,
AccountCorporation,
AccountCorporationName,
AccountDescription,
Budget,
BudgetYTD,
RowUpdateDateTime
FROM
datasources\GlBudgetsByPeriod2011.qvd
(
qvd);

I have actual amounts (not shown here) by day, and need to display daily budget amounts as well.  The problem is that my budget amounts are monthly totals.  How would you go about this?  In the script?  In the expression?

• ###### Calculate Daily Budget From Monthly Totals

I forgot to mention the obvious...What I need to do is divide the monthly total by the number of days in the month to arrive at a daily budget number.

I'm wondering if I would need to create a new table with the daily numbers (for several thousand accounts), or if I could reference the daily amount for each month in the expression.

• ###### Calculate Daily Budget From Monthly Totals

This may or may not be helpful but I wrote a blog about this a while back, it helps you deal with holidays and weekends when projecting your budget from monthly to daily.

http://biventure.blogspot.com/2010/03/handling-holidays-on-corporate-calendar.html

• ###### Re: Calculate Daily Budget From Monthly Totals

This seems to be a good solution. What would be the expression to show the monthly total all dated Jan 1st to be spread about to each work day? Note my budget table has the 1st of each month with the budget totals...I need to divide the sum of those lines dated Jan 1st and times it by max current workdays of this month to get each days totals? Do you have this part of the expression?

Thanks!

• ###### Re: Calculate Daily Budget From Monthly Totals

If any body got the complete solution of question asked by Jareb Patriquin

for calculating daily budget from monthly total kindly reply.

• ###### Re: Calculate Daily Budget From Monthly Totals

Hi!

Assuming that all days have equal budget:

Calender:

Period,

Date

...

Calender_div:

Period

Count(Date) as Divider

Resident tmp_Calender

Group By Period;

Budget:

*,

Budget / Lookup('Divider','Period', Period,'Calender_div') as Daily_Budget

Resident tmp_Budget;

Join (Calender)

Drop tables tmp_Budget, Calender, Calender_div;

If you want to add holidays or your company has some special dates, then you can give excel-file to your business users and they can define working days or production dates there and you can subtract those in script:

Open:

C as Open

FROM ...

Also with excel-file you can give different weight for days, if for example Monday has 50% of sales budgeted for certain week.

Br,

Miikka

Climber Finland

• ###### Re: Calculate Daily Budget From Monthly Totals

can u please tell what period is?

• ###### Re: Calculate Daily Budget From Monthly Totals

Period is year-month.

In above script something like this (depending on calender).

Year(PeriodEndDateTime)&Num(Month(PeriodEndDateTime),'00) as Period

Format really doesn't matter, it just has to be same in calender and in budget. Now it can be 2014-05, 201405, 1405, ...

Miikka

Climber Finland