Page 1 of 1

Update Forecast version with budget

Posted: Tue Jul 31, 2012 6:18 pm
by dfrench77
I have created a rule to dynamically feed my actuals amount to my forecast. I used a rule because I want the actual amount in the forecast to be read only. I have created a turbo integrator script to copy my budget amount to my forecast periods. Forecast periods are any period >= current month. I used a turbo integrator process because future forecast period need to writable. Below is my TI script.

Issue: Only the last forecast period is getting updated when I run the TI script.


pnCurrent_Month = CellGetn('Assumption', 'Current Month','Numeric Value');

# How long are the dimensions?
I_DimSiz_Assumption_Period = DimSiz( 'Assumption Item');

# Initialise the counters.
I_Assumption_Periods_Idx = 1;

# Get the name of the Assumption Item element.

psAssumptions_Periods = DimNm ( 'Assumption Item', I_Assumption_Periods_Idx );

# Loop through the Assumption_Periods

pnForecast_Months = Cellgetn('Assumption', psAssumptions_Periods, 'Numeric Value');

While ( I_Assumption_Periods_Idx = I_DimSiz_Assumption_Period);

If (pnForecast_Months >= pnCurrent_Month);

CellPutN(NVALUE, 'Operating Expenses v2','FORECASTS',V2,V3,Location,Department,AssumptionPeriods,Account,'Amount');

Else;

Endif;

I_Assumption_Periods_Idx = I_Assumption_Periods_Idx + 1;

End;


My Text output file
pnCurrent_Month ="19281",
pnForecast_Months = "19281"
Budget Amount = "1"

Re: Update Forecast version with budget

Posted: Tue Jul 31, 2012 7:23 pm
by tomok
dfrench77 wrote:CellPutN(NVALUE, 'Operating Expenses v2','FORECASTS',V2,V3,Location,Department,AssumptionPeriods,Account,'Amount');
i don't see anywhere in your code where you are updating the variable AssumptionPeriod. Therefore, in every iteration in your loop you are writing to the same one.

Re: Update Forecast version with budget

Posted: Tue Jul 31, 2012 7:35 pm
by dfrench77
Tomok,

Thanks for your insight. Btw - I am an accountant not an information technology guy. I would you suggest that I update the AssumptionPeriods in the while statement loop?

Thanks,

Desi

Re: Update Forecast version with budget

Posted: Wed Aug 01, 2012 12:33 am
by tomok
dfrench77 wrote:I would you suggest that I update the AssumptionPeriods in the while statement loop?
I assume you mean to say "how" instead of "I". Nevertheless, how would I possibly know? I know nothing about your model. I take it you didn't write this code but instead inherited someone else's handiwork. No one is going to be able to help you without more information. Who wrote the TI? What is the data source for the TI? What does the variable AssumptionPeriods represent? Where does the original value in that variable come from?, etc...?

Re: Update Forecast version with budget

Posted: Wed Aug 01, 2012 11:46 am
by dfrench77
Tomok,

Thank for your inquiries. I understand that you are trying to help by getting more information. Below I tried to answer your questions.
Who wrote the TI? What is the data source for the TI?

I think I lifted the code from a TM1 Forum post. I have used it successfully for other TI scripts. I was trying to incorporate it in a new TI script.
The data source is a TM1 cube view.
What does the variable AssumptionPeriods represent?
It represents a date string e.g. "12-12-18".
Where does the original value in that variable come from? etc...?
The original value in the variable comes from the dimension elements. I not sure this answers your question. Please clarify.


Please let me know if there is any additional information that I cam provide.

Regards,

Desi