TI Process problem

Post Reply
jjramirez
Posts: 31
Joined: Fri Jan 13, 2017 12:33 pm
OLAP Product: IBM Planning Analytics/TM1
Version: 2.0.9.15
Excel Version: Excel 2019

TI Process problem

Post by jjramirez »

Hi there!

I need to execute this TI process for 12 months, when i run it for one month it works perfect for any month, but when i try to run all months using a script as follows the results are not the same (the values are always increased)

Code: Select all

ExecuteProcess ('Proceso.Gastos.Fijos', 'pTipo','P','pVersion','Presupuesto Trabajo','pTipoPeriodo','M','pPeriodo','2017.01','pTerminal','SPRC');

ExecuteProcess ('Proceso.Gastos.Fijos', 'pTipo','P','pVersion','Presupuesto Trabajo','pTipoPeriodo','M','pPeriodo','2017.02','pTerminal','SPRC');
... until 2017.12 (the others parameters never change)

I don't understand why, if i am using the same TI instruction repeated 12 times.
User avatar
Alan Kirk
Site Admin
Posts: 6606
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: TI Process problem

Post by Alan Kirk »

jjramirez wrote: I need to execute this TI process for 12 months, when i run it for one month it works perfect for any month, but when i try to run all months using a script as follows the results are not the same (the values are always increased)

Code: Select all

ExecuteProcess ('Proceso.Gastos.Fijos', 'pTipo','P','pVersion','Presupuesto Trabajo','pTipoPeriodo','M','pPeriodo','2017.01','pTerminal','SPRC');

ExecuteProcess ('Proceso.Gastos.Fijos', 'pTipo','P','pVersion','Presupuesto Trabajo','pTipoPeriodo','M','pPeriodo','2017.02','pTerminal','SPRC');
... until 2017.12 (the others parameters never change)

I don't understand why, if i am using the same TI instruction repeated 12 times.
You've really given us nothing to go on here. The name of the called process translates as "Fixed Costs Process" but there is no indication of what the process is supposed to do, much less the actual code for it. There's no indication of what output it's supposed to generate (updating a cube? Updating a database? Writing to a text file?) and consequently where this "increase" is being seen, or even what the "increase" is. (Is the output showing a YTD value, is it some other increase?)

It's probably something to do with how you have incremental writes coded, but it's unlikely that anyone could guess what without a lot more relevant information.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
jjramirez
Posts: 31
Joined: Fri Jan 13, 2017 12:33 pm
OLAP Product: IBM Planning Analytics/TM1
Version: 2.0.9.15
Excel Version: Excel 2019

Re: TI Process problem

Post by jjramirez »

Hi Alan!
Thanks in advanced for your quick answer.

You're right i didnt give you any detail.
This process take the monthly total fix cost and distributes it between every income item based on the percentage of share of total incomes.

For example, taking a total fix cost as 60 for one month, the process has to calculate the fix cost assignment for each item as follows:

incomes share fix cost assigment
item 1 20 0.2 12
item 2 50 0.5 30
item 3 30 0.3 18
Total 100 1 60

Each month has differents values. When i execute the proccess for one month and wait until it finishes and immediately run it for the next month, it works fine. But i dont want to wait to clic month by month and that's why i wrote the repeated instruction for all months into a Ti process that call twelves times the original proccess. But the results are wrong in this way... in the same example doing this way i got 70 instead of 60 and it occurs for all months after the first one. I mean, for the first month it works but then it begins to increase the values for each month.


Its a simple calculation but my question is pointed into the fact that if i create a proccess to excecute any action or calculation why it doesnt work if i repeat the action n times for diferents periods even when each period has indepent figures and the calculation is not mixing figures among periods. Why if i wait until every period finish and run the next it works perfect and not with calling the process n times?
Do i have to write something between each instruction to confirm the previous is finished and then continue with the next?
User avatar
Steve Rowe
Site Admin
Posts: 2416
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

Re: TI Process problem

Post by Steve Rowe »

Can you put your actual code please?
You've explained in more detail what you want to do but not explained at all how (i.e. the code) you are doing it.
Technical Director
www.infocat.co.uk
jjramirez
Posts: 31
Joined: Fri Jan 13, 2017 12:33 pm
OLAP Product: IBM Planning Analytics/TM1
Version: 2.0.9.15
Excel Version: Excel 2019

Re: TI Process problem

Post by jjramirez »

Good afternoon!

Sure!
The process that i metioned "Proceso.gastos.Fijos" is just calling two another process into its prolog tab. So please find attached the two processes detail (prolog, data and epilog).

Please forgive the language, some notes are in spanish, but majority in english. This processes were made it from another guy almost two years ago and i understand the all the logic but i cant find out why it doesnt work running all months as i said.

I hoe you can help me.
Thank you so much in advance for your time.
Attachments
Prologo_Process1.txt
prolog process 1
(18 KiB) Downloaded 201 times
Epilogo_Process1.txt
epilog process 1
(2.84 KiB) Downloaded 188 times
Datos_Process1.txt
data process 1
(3.21 KiB) Downloaded 212 times
jjramirez
Posts: 31
Joined: Fri Jan 13, 2017 12:33 pm
OLAP Product: IBM Planning Analytics/TM1
Version: 2.0.9.15
Excel Version: Excel 2019

Re: TI Process problem

Post by jjramirez »

please find attached the second process.

The first one is to calculate the share (% of total incomes) and the second is to calculate the values (total fix cost * share)
Attachments
Prologo_Process2.txt
prolog process 2
(15.7 KiB) Downloaded 186 times
Epilogo_Process2.txt
epilog process 2
(3.31 KiB) Downloaded 194 times
Datos_Process2.txt
data process 2
(2.22 KiB) Downloaded 190 times
jjramirez
Posts: 31
Joined: Fri Jan 13, 2017 12:33 pm
OLAP Product: IBM Planning Analytics/TM1
Version: 2.0.9.15
Excel Version: Excel 2019

Re: TI Process problem

Post by jjramirez »

Good mornig!

As i told you, running the process month by month it works pretty well, but calling the process 12 times into a script the results were diferent.... always a litlle above. Someone said maybe running all months this way there's no enough time to commit the data and this is the cause of the problem.
According to that, i put a "SaveDataAll;" instruccion after each month finish and it works fine.
but i not sure this is the best practice, what do you think?

Code: Select all

ExecuteProcess ('Proceso.Gastos.Fijos', 'pTipo','P','pVersion','Presupuesto Trabajo','pTipoPeriodo','M','pPeriodo','2017.01','pTerminal','SPRC');
SaveDataAll ;
ExecuteProcess ('Proceso.Gastos.Fijos', 'pTipo','P','pVersion','Presupuesto Trabajo','pTipoPeriodo','M','pPeriodo','2017.02','pTerminal','SPRC');
SaveDataAll ;
ExecuteProcess ('Proceso.Gastos.Fijos', 'pTipo','P','pVersion','Presupuesto Trabajo','pTipoPeriodo','M','pPeriodo','2017.03','pTerminal','SPRC');
SaveDataAll ;
ExecuteProcess ('Proceso.Gastos.Fijos', 'pTipo','P','pVersion','Presupuesto Trabajo','pTipoPeriodo','M','pPeriodo','2017.04','pTerminal','SPRC');
SaveDataAll ;
ExecuteProcess ('Proceso.Gastos.Fijos', 'pTipo','P','pVersion','Presupuesto Trabajo','pTipoPeriodo','M','pPeriodo','2017.05','pTerminal','SPRC');
SaveDataAll ;
ExecuteProcess ('Proceso.Gastos.Fijos', 'pTipo','P','pVersion','Presupuesto Trabajo','pTipoPeriodo','M','pPeriodo','2017.06','pTerminal','SPRC');
SaveDataAll ;
ExecuteProcess ('Proceso.Gastos.Fijos', 'pTipo','P','pVersion','Presupuesto Trabajo','pTipoPeriodo','M','pPeriodo','2017.07','pTerminal','SPRC');
SaveDataAll ;
ExecuteProcess ('Proceso.Gastos.Fijos', 'pTipo','P','pVersion','Presupuesto Trabajo','pTipoPeriodo','M','pPeriodo','2017.08','pTerminal','SPRC');
SaveDataAll ;
ExecuteProcess ('Proceso.Gastos.Fijos', 'pTipo','P','pVersion','Presupuesto Trabajo','pTipoPeriodo','M','pPeriodo','2017.09','pTerminal','SPRC');
SaveDataAll ;
ExecuteProcess ('Proceso.Gastos.Fijos', 'pTipo','P','pVersion','Presupuesto Trabajo','pTipoPeriodo','M','pPeriodo','2017.10','pTerminal','SPRC');
SaveDataAll ;
ExecuteProcess ('Proceso.Gastos.Fijos', 'pTipo','P','pVersion','Presupuesto Trabajo','pTipoPeriodo','M','pPeriodo','2017.11','pTerminal','SPRC');
SaveDataAll ;
ExecuteProcess ('Proceso.Gastos.Fijos', 'pTipo','P','pVersion','Presupuesto Trabajo','pTipoPeriodo','M','pPeriodo','2017.12','pTerminal','SPRC');
SaveDataAll ;
Wim Gielis
MVP
Posts: 3113
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: TI Process problem

Post by Wim Gielis »

At least consider a CubeSaveData statement.
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
jjramirez
Posts: 31
Joined: Fri Jan 13, 2017 12:33 pm
OLAP Product: IBM Planning Analytics/TM1
Version: 2.0.9.15
Excel Version: Excel 2019

Re: TI Process problem

Post by jjramirez »

Thanks Wim!
i just need to save one cube, so it's so much better use this fuction.

Code: Select all

CubeSaveData('C.Ingreso.Gasto.OP');
best regards!
Post Reply