Copy Process Error - Could not Intialize the process

Post Reply
Acc_Moonwalk
Posts: 32
Joined: Fri May 27, 2011 9:06 am
OLAP Product: TM1
Version: 9.4
Excel Version: 2003

Copy Process Error - Could not Intialize the process

Post by Acc_Moonwalk »

Hi All, I am trying to write the copy process.
I have 6 dimensions in my cube , I am trying to copy from one channel to other channel and one budget version to other budget version.
in the Subprocess i am copying the data :
Main process code:
vCube = 'Sales_Plan';
vView = 'Sales_plane_View';
vSub = 'Sales_Plan_Sub';

ViewDestroy(vCube,vView);

SubsetDestroy('Subsidiaries',vSub);
SubsetDestroy('Channel',vSub);
SubsetDestroy('Products',vSub);
SubsetDestroy('Versions',vSub);
SubsetDestroy('sales_plan_Measures',vSub);
SubsetDestroy('Months',vSub);


SubsetCreatebyMDX(vSub,'{TM1FILTERBYLEVEL( {TM1SUBSETALL( [Subsidiaries] )}, 0)} ' );
SubsetCreatebyMDX(vSub,'{TM1FILTERBYLEVEL( {TM1SUBSETALL( [Channel] )}, 0)} ' );
SubsetCreatebyMDX(vSub,'{TM1FILTERBYLEVEL( {TM1SUBSETALL( [Products] )}, 0)} ' );
SubsetCreate('Versions',vSub);
SubsetElementInsert('Versions',vSub,pBudgetTarget,1);
SubsetCreatebyMDX(vSub,'{TM1FILTERBYLEVEL( {TM1SUBSETALL( [Sales_Plan_Measures] )}, 0)} ' );
SubsetCreatebyMDX(vSub,'{TM1FILTERBYLEVEL( {TM1SUBSETALL( [Months] )}, 0)} ' );

ViewCreate(vCube,vView);

ViewSubsetAssign(vCube,vView,'Subsidiaries',vSub);
ViewSubsetAssign(vCube,vView,'Channel',vSub);
ViewSubsetAssign(vCube,vView,'Products',vSub);
ViewSubsetAssign(vCube,vView,'Versions',vSub);
ViewSubsetAssign(vCube,vView,'Sales_Plan_Measures',vSub);
ViewSubsetAssign(vCube,vView,'Months',vSub);

ViewZeroOut(vCube,vView);

ViewDestroy(vCube,vView);

SubsetDestroy('Subsidiaries',vSub);
SubsetDestroy('Channel',vSub);
SubsetDestroy('Products',vSub);
SubsetDestroy('Versions',vSub);
SubsetDestroy('sales_plan_Measures',vSub);
SubsetDestroy('Months',vSub);


SubsetCreatebyMDX(vSub,'{TM1FILTERBYLEVEL( {TM1SUBSETALL( [Subsidiaries] )}, 0)} ' );
SubsetCreatebyMDX(vSub,'{TM1FILTERBYLEVEL( {TM1SUBSETALL( [Channel] )}, 0)} ' );
SubsetCreatebyMDX(vSub,'{TM1FILTERBYLEVEL( {TM1SUBSETALL( [Products] )}, 0)} ' );
SubsetCreate('Versions',vSub);
SubsetElementInsert('Versions',vSub,pBudgetSource,1);
SubsetCreatebyMDX(vSub,'{TM1FILTERBYLEVEL( {TM1SUBSETALL( [Sales_Plan_Measures] )}, 0)} ' );
SubsetCreatebyMDX(vSub,'{TM1FILTERBYLEVEL( {TM1SUBSETALL( [Months] )}, 0)} ' );

ViewCreate(vCube,vView);

ViewSubsetAssign(vCube,vView,'Subsidiaries',vSub);
ViewSubsetAssign(vCube,vView,'Channel',vSub);
ViewSubsetAssign(vCube,vView,'Products',vSub);
ViewSubsetAssign(vCube,vView,'Versions',vSub);
ViewSubsetAssign(vCube,vView,'Sales_Plan_Measures',vSub);
ViewSubsetAssign(vCube,vView,'Months',vSub);

ViewExtractSkipRuleValuesSet (vCube,vView, 1);


ExecuteProcess('Sales_Plan', 'pView',vView, 'pChannelTarget', pChannelTarget, 'pBudgetTarget', pBudgetTarget);

ViewDestroy(vCube,vView);

SubsetDestroy('Subsidiaries',vSub);
SubsetDestroy('Channel',vSub);
SubsetDestroy('Products',vSub);
SubsetDestroy('Versions',vSub);
SubsetDestroy('sales_plan_Measures',vSub);
SubsetDestroy('Months',vSub);

Subprocess Code:
In Data Tab:
CellPutN(Value, 'Sales_plan',Subsidiaries, pChannelTarget,Products, pBudgetTarget,Sales_Plan_Measures,Months);

Error I am getting when i click on Run :
5364 ERROR 2012-01-24 05:54:36,885 TM1.Process Process "Copy Process": Could not initialize process
Can you please help on this error
Regards
Ashok
Gregor Koch
MVP
Posts: 263
Joined: Fri Jun 27, 2008 12:15 am
OLAP Product: Cognos TM1, CX
Version: 9.0 and up
Excel Version: 2007 and up

Re: Copy Process Error - Could not Intialize the process

Post by Gregor Koch »

Hi

Generally I would avoid dynamic subsets in your copy process, but that is (probably) not why you get your error.

I guess your ExecuteProcess line either has a wrong process or parameter name in it.

Why don't you have a look at copy processes at http://www.BedrockTM1.org, you might be able to use existing processes or get an idea on how to better do what you need to do.
Edward Stuart
Community Contributor
Posts: 248
Joined: Tue Nov 01, 2011 10:31 am
OLAP Product: TM1
Version: All
Excel Version: All
Location: Manchester
Contact:

Re: Copy Process Error - Could not Intialize the process

Post by Edward Stuart »

Hi,

Are you calling the process you are running? This could be another reason for it falling over,

Edd
Wim Gielis
MVP
Posts: 3128
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: Copy Process Error - Could not Intialize the process

Post by Wim Gielis »

For debugging purposes, I would not destroy the view and the subsets.
See whether they contain the expected elements / data.
Beware: such a view can be large and consume a lot of memory if you try to open it.
First check the subsets, then the view.

Next to that, why do you create the subsets, destroy them and create them again (exactly the same code)?
You can also clean up these temporary objects in the Epilog part of the process.

As mentioned above, you should check the hard-coded elements (names of process, cube and so on).
Use ASCIIOUTPUT to output text to a file.

@Gregor:

Why would you avoid dynamic subsets in processes like these? It avoids loops which could be endless with a simple oversight (I did this in the past...).
Only caveat is that MDX'es should have at least 1 element. Other than that, I almost ALWAYS use them in processes like this, unless the syntax or subset at hand is too complex.
In general, I use a mix of MDX and static subsets, whichever is more practical.
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
lotsaram
MVP
Posts: 3667
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Copy Process Error - Could not Intialize the process

Post by lotsaram »

Wim Gielis wrote:Why would you avoid dynamic subsets in processes like these? It avoids loops which could be endless with a simple oversight (I did this in the past...).
Only caveat is that MDX'es should have at least 1 element. Other than that, I almost ALWAYS use them in processes like this, unless the syntax or subset at hand is too complex.
In general, I use a mix of MDX and static subsets, whichever is more practical.
Hi Wim, I can think of one very compelling reason, performance. In the code example here the first time vView is used it is to do a ViewZeroOut, in which case I agree dynamic subsets vs. static ones doesn't matter since the subsets are only evaluated once (but I'd still argue against assigning a dynamic ALL subset to a view for this purpose as it is unnecessary. Better and more efficient just to not assign anything for those dimensions ...) However for the 2nd part of the code where vView is rebuilt and passed as a parameter to a process, presumably as a data source, then this is much better using static subsets due to the potential performance impact of the data source being re-evaluated with each record processed.

While I agree MDX can be more efficient than a while loop for code efficiency, this assumes you are writing code from scratch each time. I have pretty much converted to using bedrock for most things like this now which means something like the example from the OP can be achieved in about 5 lines of new code which is a real advantage from having a common library of "functionalized" TI processes. (Not to mention the advantages for newer developers who also get the advantage of fully unit tested functions with optional debugging output.)
Post Reply