Page 1 of 1

Need help to create TI process to copy data

Posted: Mon Oct 09, 2017 7:52 am
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!!!

Re: Need help to create TI process to copy data

Posted: Mon Oct 09, 2017 8:41 am
by Drg
emmm... Use

Code: Select all

while 
copy data from one month to other month 
end;
maybe should use bedrock process !

Re: Need help to create TI process to copy data

Posted: Tue Oct 10, 2017 5:50 am
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;

Re: Need help to create TI process to copy data

Posted: Tue Oct 10, 2017 2:42 pm
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.

Re: Need help to create TI process to copy data

Posted: Wed Oct 18, 2017 2:14 pm
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

Re: Need help to create TI process to copy data

Posted: Fri Oct 20, 2017 3:27 am
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.