Page 1 of 1

Adding a cube to an Archive Version 10.2.002

Posted: Fri Aug 14, 2015 8:16 pm
by RNB
I'm trying to write data from a cube's Forecast Version to an Archive Version. The code already exists for several cubes so I thought adding the data from another cube would be easy.
The Chore contains a process that creates the New Version Element based on the date and passes this through a global variable. This piece works fine and remains untouched by me. The second process creates the Subsets and Views used to write the data. I've added the code below;

###Finance Salary US Factors Cube
SubsetCreate(SalaryUSVersion,SubsetName);
SubsetElementInsert(SalaryUSVersion,SubsetName,SourceVersion,1);
SubsetCreate('FinanceSalaryFactorsYear', subsetName);
SubsetElementInsert('FinanceSalaryFactorsYear', subsetName, CurrentForecastYear, 4);
ViewCreate(USFactors, ViewName);
ViewSubsetAssign(USFactors, ViewName, SalaryUSVersion, SubsetName);
ViewSubsetAssign(USFactors, ViewName, 'FinanceSalaryFactorsYear', SubsetName);
ViewRowDimensionSet(USFactors, ViewName, tabdim(USFactors, 1), 1);
ViewRowDimensionSet(USFactors, ViewName, tabdim(USFactors, 2), 2);
ViewRowDimensionSet(USFactors, ViewName, tabdim(USFactors, 3), 3);
ViewRowDimensionSet(USFactors, ViewName, tabdim(USFactors, 4), 4);
ViewRowDimensionSet(USFactors, ViewName, tabdim(USFactors, 5), 5);
ViewRowDimensionSet(USFactors, ViewName, tabdim(USFactors, 6), 6);
viewSetSkipCalcs( USFactors, ViewName, 1 );
viewSetSkipZeroes( USFactors, ViewName, 1 );
viewSetSkipRuleValues( USFactors, ViewName, 0);

It is very similar to existing code that works;
###SalaryUS Cube
SubsetCreate(SalaryUSVersion,SubsetName);
SubsetElementInsert(SalaryUSVersion,SubsetName,SourceVersion,1);
ViewCreate(SalaryUSCube,ViewName);
ViewSubsetAssign( SalaryUSCube, ViewName, SalaryUSVersion, SubsetName );
ViewSubsetAssign( SalaryUSCube, ViewName, 'FinanceGLPeriod', SubsetName );
ViewRowDimensionSet(SalaryUSCube, ViewName, tabdim(SalaryUSCube,1), 1);
ViewRowDimensionSet(SalaryUSCube, ViewName, tabdim(SalaryUSCube,2), 2);
ViewRowDimensionSet(SalaryUSCube, ViewName, tabdim(SalaryUSCube,3), 3);
ViewRowDimensionSet(SalaryUSCube, ViewName, tabdim(SalaryUSCube,4), 4);
ViewRowDimensionSet(SalaryUSCube, ViewName, tabdim(SalaryUSCube,5), 5);
ViewRowDimensionSet(SalaryUSCube, ViewName, tabdim(SalaryUSCube,6), 6);
ViewRowDimensionSet(SalaryUSCube, ViewName, tabdim(SalaryUSCube,7), 7);
ViewRowDimensionSet(SalaryUSCube, ViewName, tabdim(SalaryUSCube,8), 8);
ViewRowDimensionSet(SalaryUSCube, ViewName, tabdim(SalaryUSCube,9), 9);
viewSetSkipCalcs( SalaryUSCube, ViewName, 1 );
viewSetSkipZeroes( SalaryUSCube, ViewName, 1 );
viewSetSkipRuleValues( SalaryUScube, ViewName, 0);

The Cube looks like this;
Finance Salary US Factors
DIMS
FinanceSalaryCompany 1
FinanceAccountCategory 2
FinanceSalaryUSVersion 3
FinanceSalaryFactorTypes 5
FinanceSalaryFactorsMeasures 6

This piece writes the data;

Data Source Name: TM1-Finance-QA:Finance Salary US Factors->temp_FinanceArchiveVersion

#****Begin: Generated Statements***
#****End: Generated Statements****


# =============================== SECTION - DATA ===============================

IF (cellIsUpdateable (vCubeName, FinanceSalaryCompany,
FinanceAccountCategory,
FinanceSalaryUSVersion,
FinanceSalaryFactorsYear,
FinanceSalaryUSFactorTypes,
FinanceSalaryFactorsMeasures) = 1);

IF (Value_Is_String = 0);
cellPutN (NValue, vCubeName, FinanceSalaryCompany,
FinanceAccountCategory,
FinanceSalaryUSVersion,
FinanceSalaryFactorsYear,
FinanceSalaryUSFactorTypes,
FinanceSalaryFactorsMeasures);
ELSEIF (Value_Is_String = 1);
cellPutS (SValue, vCubeName, FinanceSalaryCompany,
FinanceAccountCategory,
FinanceSalaryUSVersion,
FinanceSalaryFactorsYear,
FinanceSalaryUSFactorTypes,
FinanceSalaryFactorsMeasures);
ENDIF;
ENDIF;

I'm getting this;
Error: Prolog procedure line (0): Unable to open data source "Finance Salary US Factors".

Which leads me to believe the subsets and views aren't getting created.
Any help is much appreciated.

Re: Adding a cube to an Archive Version 10.2.002

Posted: Sat Aug 15, 2015 5:30 am
by BariAbdul
Sorry,I couldn't see in your code:

Code: Select all

 #-------Assign Data Source---#

DataSourceType='View';
DataNameForServer=' View_Name';
DataSourceNameForClient='View_Name';
DataSourceCubeView='vView';
Thanks

Re: Adding a cube to an Archive Version 10.2.002

Posted: Sat Aug 15, 2015 5:48 pm
by Wim Gielis
Hello,

Code: Select all

ViewRowDimensionSet
code is irrelevant in this kind of data-integration processes.

As to the problem:

Do you set the data source manually in the Data source tab ? Or through code ?
Did you debug to see if the subsets and views are created ? As long as you don't delete the temporary objects in the Epilog for instance,
that should be quite easy to test. Do they exist or not ? If you want to be certain, change the names a bit and test again.