Need help to create TI process to copy data

Post Reply
amit_hhh
Posts: 28
Joined: Wed Jan 18, 2017 3:27 pm
OLAP Product: Cognos TM1
Version: 10.2.2, 11
Excel Version: Excel2010
Location: Bangalore, India

Need help to create TI process to copy data

Post by amit_hhh »

Hello All,

I am new to Cognos TM1 and have to create a TI process to copy data for specific fields from a particular month of a year for Version 1 to all the months of next year for version 2.
e.g. Data for Nov-16 for version 1 is to be copied to months from Jan-17 to Dec-17 for version 2 of the same cube. Also I have to generalise this process so that it can be reused for different months.

Looking forward for responses. Thanks!!!
Regards,
Amit Saxena
India
Drg
Regular Participant
Posts: 159
Joined: Fri Aug 12, 2016 10:02 am
OLAP Product: tm1
Version: 10.2.0 - 10.3.0
Excel Version: 2010

Re: Need help to create TI process to copy data

Post by Drg »

emmm... Use

Code: Select all

while 
copy data from one month to other month 
end;
maybe should use bedrock process !
ascheevel
Community Contributor
Posts: 286
Joined: Fri Feb 15, 2013 5:49 pm
OLAP Product: TM1
Version: PA 2.0.9.1
Excel Version: 365
Location: Minneapolis, USA

Re: Need help to create TI process to copy data

Post by ascheevel »

To expand on what Drg said, you can use a WHILE loop to apply one value to multiple target elements, periods in this case. If I'm understanding your question right, you're trying to take a value from one month in the current year, say October, and write that value to all the months in the next year, Jan-Dec. Below is an example of a WHILE loop that would write the value from the view source in the cube SomeCube to all the time periods in the Time dimension subset Next Year.

Code: Select all

vDim1 = 'Time';
vSubset1 = 'Next Year';
vVersionTar = 'Version 2';
vCube1 = 'SomeCube';

index1 = 1;
vLimit = SubsetGetSize(vDIM1, vSubset1);

WHILE(index1 <= vLimit);
	vTimeTar = SubsetGetElementName(vDim1, vSubset1, index1);
	CellPutN(Value, vCube1, vVersionTar, vTimeTar);
	index1 = index1 + 1;
END;
User avatar
tiagoblauth79
Posts: 25
Joined: Fri Aug 26, 2016 1:42 pm
OLAP Product: Cognos BI and TM1
Version: 10.2.2
Excel Version: 10
Contact:

Re: Need help to create TI process to copy data

Post by tiagoblauth79 »

Hi. We like new guys so we think we are smart. But no one will create the full code for you.
The source date, target start date and end date can be in the process parameters.
Beginners do one process per cube. If you have more than one cube to copy, you can create a master process to run the copy from all cubes.
Each process: You should create a view to read the data from the cube, create a simple view and adjust filters in the prolog.
Prolog: recreate the view and apply the filters you need (ViewDestroy, ViewCreate, SubsetDestroy, SubsetCreate, ViewSubsetAssign). A few people will suggest you to adjust the view in an external process, I never have any issue with this approach in version 10.1 and superior.
Data: with a WHILE, write the values in the interval of data to the target start and end date, if you create the time dimension by using the Modeler, you have a numeric attribute that determines the date. Much easiest to check if the date is in the interval of dates. (WHILE, ATTRN, CellPutN)
Epilog: clean temporary view and subsets (ViewDestroy, SubsetDestroy).

Good luck.
BobMilli
Posts: 8
Joined: Thu Feb 28, 2013 9:45 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2010

Re: Need help to create TI process to copy data

Post by BobMilli »

Hello,
Did you notice that since TM1 10.2.2 FP4 you could use an additional optional parameter which, when you create objects (subsets & views), will make them temporary so no more cleaning needed in the Epilog, they'll be automatically destroyed once the TI process has finished.

See : http://www-01.ibm.com/support/docview.w ... wg27046436
Wim Gielis
MVP
Posts: 3103
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: Need help to create TI process to copy data

Post by Wim Gielis »

BobMilli wrote: Wed Oct 18, 2017 2:14 pm Hello,
Did you notice that since TM1 10.2.2 FP4 you could use an additional optional parameter which, when you create objects (subsets & views), will make them temporary so no more cleaning needed in the Epilog, they'll be automatically destroyed once the TI process has finished.

See : http://www-01.ibm.com/support/docview.w ... wg27046436
Hi Robert,

Long time no see, hope all is well with you !

Just to add that indeed 10.2.2 FP4 had this functionality but temporary objects for the data source of a TI process did not work correctly in that version. In some version launched soon after it IBM corrected it so 10.2.2 FP4 base version is not sufficient.
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
Post Reply