TI to copy data within a cube

Post Reply
IanB
Posts: 22
Joined: Tue Jul 01, 2008 2:12 pm
OLAP Product: TM1 SSAS
Version: 9.5,10.2
Excel Version: 2010 2013 2016
Location: UK

TI to copy data within a cube

Post by IanB »

For years, I've used the Excel process worksheets to copy data between scenarios within cubes. I use a simple looking Excel macro driven workbook to enable users to do this task without assistance - enter dimension items in a table - click a button to create a query file and process

Now, finally, its is time to move on.
TI is the way forward!

Does anyone have some advice on where to start
I want to set up a user-driven process that inspires the same confidence as my trusty Excel solution
It needs to be parameter controlled and simple to adapt to different situations

Thanks in advance

IanB
User avatar
Eric
MVP
Posts: 373
Joined: Wed May 14, 2008 1:21 pm
OLAP Product: TM1
Version: 9.4
Excel Version: 2003
Location: Chicago, IL USA

Re: TI to copy data within a cube

Post by Eric »

Depends.

1) If you are going to do a ODBC, which I recommmend, just set it up as click execute and the TM1 updates auto-magically.

2) Data for bugest might not be in a database.
Keep the GUI the same. Have the user populate the same spreaadsheets the always have. Write a macro to convert the data to a .txt file and save in a directory the TM1 server can access. Then hav ethe user execture the TI process and magic again!

The key is if you stick with text files the format has to stay the same on onyl change what they want changed nothing else.
Regards,
Eric
Blog: http://tm1-tipz.blogspot.com
Articles: http://www.google.com/reader/shared/use ... /label/TM1


Production: 32 bit 9.0 SP2, Windows 2000 Advanced Server. Web: 32 bit 9.0 SP2, Windows 2000 Server. Excel 2003
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: TI to copy data within a cube

Post by Gregor Koch »

@Eric: Not sure if your answer was meant to be in another thread but hey... maybe I am totally off track here.

@IanB
If you want to copy data within a cube, that's at least how I understand your question then I wouldn't "do a ODBC" or worry about how to get the Budget (?) form a data source (other than your cube).

To give you some pointers here is some simplified code for a process.
The DataSource of your Process is a Cube View named 'SomeSource'
Parameters in this example are the source and target scenarios pSourceScenario and pTargetScenario

###
#Prolog Tab
###
cViewName='SomeSource';
cSubsetName='Temp';

ViewDestroy(cCubeName, cViewName);
ViewCreate(cCubeName, cViewName);

## Scenario dimension
cDim = 'YourScenarioDim';
SubsetDestroy(cDim, cSubsetName );
SubsetCreate(cDim, cSubsetName );
#Insert Element to Subset
SubsetElementInsert(cDim, cSubsetName , pSourceScenario, 1);
#Assign the subset to View
ViewSubsetAssign( cCubeName, cViewName, cDim, cSubsetName);

#clearing the target scenario is also recommended

###
#Data Tab
###
CellPutN(value, cCubeName, pTargetScenario, dim01, dim02, ....);

###
#Epilog Tab
###
#Some clean ups like
cDim = 'YourScenarioDim';
SubsetDestroy(cDim, cSubsetName );


Before I totally go on in the wrong direction give me some feedback if that is what you are looking for.
In general: If you haven't got any experience with TI I'd start off with using the Wizard and then adjust the code.

Cheers

Gregor
Last edited by Gregor Koch on Thu Oct 02, 2008 12:05 am, edited 1 time in total.
User avatar
Renaud MARTIAL
Posts: 25
Joined: Thu May 15, 2008 10:18 am
Location: Paris, France

Re: TI to copy data within a cube

Post by Renaud MARTIAL »

IanB,

I presume the source element already exist in the dimension.
So, you have to insert the destination element into the dimension (if if doesn't exists ...)

Furthermore, you should check that the process doesn't halt because of incorrect parameters of invalid 'context'.
For example, you'll have (in the prolog) to :
- check that the source dimension element really exists
- ensure that the views and subset created within the process are unique, so that if 2 users want to do the same thing there won't be conflicts
- in the epilog, destroy the view and subset created in the prolog.


Renaud.
IanB
Posts: 22
Joined: Tue Jul 01, 2008 2:12 pm
OLAP Product: TM1 SSAS
Version: 9.5,10.2
Excel Version: 2010 2013 2016
Location: UK

Re: TI to copy data within a cube

Post by IanB »

A bit of a delay on my reply - but finally... Gregor indeed has the right idea - thanks for putting me on the right track

To clarify:
One of my most-used TM1 models manages a rolling planning function. I need to maintain visibility of last month's forecast, the one before... up to 3 generations back. The scenario names are static - thus FC, Lag1, Lag2, Lag3. Users maintain data in FC. Each month, the admin copies data from Lag 2 to Lag3, Lag 1 to Lag2 and FC to Lag1 - zeroing out the destination slice first.

My objective was to create a process that would be simple for users to follow and provide clarity to data owners on what is happening.
Does anybody find the TI interface easy to follow? It's perhaps OK for automated processes maintained by IT - but where we need user interaction, the process is largely buried in TM1 views and it seems all too easy to make mistakes.

I have now successfully set up an Excel workbook that allows a user to maintain the view as needed and then use an action button to launch the process - passing any required parameters to the TI process - it seems to work well.

My question - what do others do? Is there an accepted "best practice" to ensure maximum reliability?

IanB
User avatar
John Hobson
Site Admin
Posts: 330
Joined: Sun May 11, 2008 4:58 pm
OLAP Product: Any
Version: 1.0
Excel Version: 2020
Location: Lytham UK
Contact:

Re: TI to copy data within a cube

Post by John Hobson »

Ian

I think you are at that horrible moment of realisation that

* TI is very powerful
* It is indeed the answer to "industrial strength" system issues like seeding plans
* It was written by people who were antiseptically quarantined from end users
* It has almost no user interactivity capability

You have come to the conclusion that the answer is to use Excel Action buttons to fill the yawning gap.

We all get there at some point I think :)

Is it the answer?

Well - You are lucky that you can at least now use action buttons and pass parameters using them. This was not the case until relatively recently. You can get users to select from pick lists this way and then use the results in a TI process, which gets around some of the "where we need user interaction, the process is largely buried in TM1 views and it seems all too easy to make mistakes" issue. From what you write this is what you are doing now

If you play with these you will shortly find that Action Buttons, whilst they may look nice in demos (as long as you don't want to resize them) were designed by programmers who were antiseptically quarantined from systems admins (who like to be able to debug errors and know when and why things don't work). The idea that a single custom "Process Failed" message was ever adequate is quite laughable really. (Were they just being very lazy, or did they maybe just forget that TI itself has multiple error codes?). Action Buttons are a quick but VERY dirty solution to a problem that Applix should have addressed a LOOOONG time ago.

There is a middle way using Applix home-brewed and unsupported API code as demo'd at a User Day a few years back (Hi Jason nice to see you looking in here btw) that calls a process with parameters AND at least provides the limited feedback messages that are native to TI. If you ask Applix nicely they may pass you a copy. I did post it a while back on the old forum I think but I'm not sure where the generic ode is on my machine just now. Let me know if you want me to hunt it down. At the end of the day though using it is very hard work for a small return and it is totally unsupported (i.e. the support team had never even heard of it when I tried using it).

I ended up reverting to action buttons and explaining to the client's slightly bemused systems administrator that "the fact that you get a success message doesn't necessarily mean it did what you expected - live with it" :cry:

Short answer - you're probably in the best place you are going to get to here without writing your very own User Interface.

Best wishes

John
John Hobson
The Planning Factory
David Usherwood
Site Admin
Posts: 1454
Joined: Wed May 28, 2008 9:09 am

Re: TI to copy data within a cube

Post by David Usherwood »

Don't forget that for 1 off data copies you can use Relative Percent Adjustment, set to 100% and use the source element as the 'basis'. Bit mucky though for production use. You need to have all other dimensions totalled but the adhoc 'Rollup' totals work fine.
Post Reply