Page 1 of 1

Copying data from one version over to another in same cube

Posted: Tue Aug 31, 2010 7:24 pm
by sachin
I am trying to get handle on using TM1. So what I am trying to do, is emulate in TM1 an EP model I built in Analyst and improvise it (where possible). This my first post on this forum, hopefully it comes out right!

I have a cube (C1) that collects information about items and has 3 versions - Input, Overwrite and Final. In Input version, we ask users to enter details related to the product like its Name, Vendor, Type, Purchase Month, 'Purchase Price' etc. There is another cube 'C2', which calculates the cash flow amount based on a 12 month cycle & purchase month. It then sends the calced amount to 'C1'. Sometimes there are extra charges in a month that a Cost Center has to bear for the product. That's where overwrite comes into picture. In Overwrite version, users have the ability to enter their own amount. The Final version will contain either Overwrite amount (if present) or calculated amount.

Between these 3 versions, only the cash flow amount is different; the attibutes related to an item like - name, vendor etc are fixed. Currently in this cube 'C1', I have written rule like this -
['Overwrite', 'Vendor Name'] = S: DB('C1', 'Input', !PurchaseType, 'Vendor Name');
['Overwrite', 'Product Name'] = S: DB('C1', 'Input', !PurchaseType, 'Product Name');
...
...
and so on for all the 11 attributes. Then repeat this for 'Final'. Thus, 22 lines to tranfer this information. I could create a subset for 'Final' and 'Overwrite' and may be able to reduce it to 11.

I have 2 questions -
1) Using rules, is there a better way to transfer these attributes of an item from 'Input' version to other 2 versions - 'Overwrite' & 'Final'?
2) If you notice in the rule, I am using a DB reference to itself. Is there a way it avoid hardcoding the cube name in DB calculation? If we decide to rename the cube (this was pretty easy in Analyst), I am afraid I have to modify the rule with this approach.

I'd appreciate any advice from you. Thank you.

TM1 9.5, Win XP, 32 bit, Excel 2003

Re: Copying data from one version over to another in same cu

Posted: Wed Sep 01, 2010 7:58 am
by MSidat
Hi Sachin,

IN response to your Q, s:

1) Using rules, is there a better way to transfer these attributes of an item from 'Input' version to other 2 versions - 'Overwrite' & 'Final'?

I guess the easiest one liner for this would be to firstly in your relevant dimension that holds old your elements like "Type, Purchase Month, 'Purchase Pric" create a separate hierachy called something like "Static Data" or some such, then ensure all your static elements which you wish to transfer to your different versions are part of this structure. Once this is accomplished your one liner will basically be something like

[{'Overwrite', 'Final'}] = S: IF(elisanc('ProductInfo','Static Data',!ProductInfo) = 1, DB('C1', 'Input', !PurchaseType, !ProductInfo), Continue);

Where ProductInfo is the name of yoru dimension that holds your static info. It basically says, if i am looking at my overwrite or final version and my product info is part of the Static Data hierarchy then I am = to what is stored in my Input Version, otherwise continue reading the rule file

2) If you notice in the rule, I am using a DB reference to itself. Is there a way it avoid hardcoding the cube name in DB calculation? If we decide to rename the cube (this was pretty easy in Analyst), I am afraid I have to modify the rule with this approach.

You can avoid hard coding it, my storing the cube name in a control cube somewhere and referencing that cube so that you just need to change the name of the cube in a viewer. and where you have 'C1' it would just be another DB statement to that control cube.

Hope this helps please check my syntax before implementing it, not got TM1 on this machine.

Re: Copying data from one version over to another in same cu

Posted: Wed Sep 01, 2010 6:00 pm
by sachin
Hello MSidat,

Thank you!

#1 - I am unable to create a hierarchy of my static data (i.e. the attributes) as they are strings. But I got the idea you were doing and tried different route. What I did is create a new attribute for the dimension in question; then for those elements, I want to repeat across various versions, I set a value. I am now using
[{'Overwrite', 'Final'}] = S: IF ( ATTRS ('Dim_Name', !Dim_Name, 'New_Attr_Name') @= 'Static', DB_Function, CONTINUE);

This works as I desired.

#2 - I have not yet started playing with control objects. I however, get your point. I will explore that options.

Once again, thank you very much.

- Sachin

Re: Copying data from one version over to another in same cu

Posted: Thu Sep 02, 2010 3:25 pm
by ajain86
Sachin,

To expand on MSidat point for number 2, a control cube is just another cube that you create to store variables that you could use anywhere in your application. It is not the TM1 control objects.

Regards,

Ankur

Re: Copying data from one version over to another in same cu

Posted: Thu Sep 02, 2010 6:07 pm
by sachin
Thanks for the clarification Ankur.

- Sachin