Adding a cube to an Archive Version 10.2.002

Post Reply
RNB
Posts: 5
Joined: Mon Jan 05, 2015 9:47 pm
OLAP Product: Cognos
Version: 9.5.2
Excel Version: 2010

Adding a cube to an Archive Version 10.2.002

Post 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.
BariAbdul
Regular Participant
Posts: 424
Joined: Sat Mar 10, 2012 1:03 pm
OLAP Product: IBM TM1, Planning Analytics, P
Version: PAW 2.0.8
Excel Version: 2019

Re: Adding a cube to an Archive Version 10.2.002

Post 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
"You Never Fail Until You Stop Trying......"
Wim Gielis
MVP
Posts: 3240
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Adding a cube to an Archive Version 10.2.002

Post 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.
Best regards,

Wim Gielis

IBM Champion 2024-2025
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
Post Reply