[SOLVED] fill cube with values filtered by attributes

Post Reply
moritz
Posts: 15
Joined: Wed Sep 04, 2013 2:26 pm
OLAP Product: TM1
Version: 10.1.1
Excel Version: Excel 2010

[SOLVED] fill cube with values filtered by attributes

Post by moritz »

Hello everyone,

im new to TM1, but i have experience in web-development coding.

I've got a short question, which bothers me for quiet a few hours. :(

I want to get the values cumulated for all elements with the Attribute "Laufend".

Code: Select all

['Output lfd. Geschäft'] = N:DB('TX_TF_RSM_OI','Output',!TX_TF_RSM_Datum,'Gesamt','Gesamt',
[[All elements with the attribute "Laufend".]]
,'Gesamt','Gesamt');
Image

I'm not sure if its the right use for attributes.

Another thing is my Rule-Editor looks like this:
Image

Any instructions how i get the normal one with code higlighting?

I'm looking forward for your answers and feedback.

Greetings from Cologne, Germany!
Moritz

PS Can you recommend any other TM1 Rule Tutorials, besides the IBM Guides?
Last edited by moritz on Wed Oct 30, 2013 3:06 pm, edited 1 time in total.
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: fill cube with values filtered by attributes

Post by tomok »

Something like this:

Code: Select all

['Output lfd. Geschäft'] = N:IF(ATTRS('TX_TF_RSM_Standort',TX_TF_RSM_Standort,'Art')@='Laufend',DB('TX_TF_RSM_OI','Output',!TX_TF_RSM_Datum,'Gesamt','Gesamt','Gesamt','Gesamt'),0);
Also, don't forget you'll need to feed Output lfd. Geschäft.

What's up with four dimensions all having the same element called "Gesamt'? There's nothing to stop you from doing this but I would argue it's going to be confusing to end users and it's going to require the Dimension:Element syntax when writing shorthand rules. Not best practice in my book, YMMV.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
moritz
Posts: 15
Joined: Wed Sep 04, 2013 2:26 pm
OLAP Product: TM1
Version: 10.1.1
Excel Version: Excel 2010

Re: fill cube with values filtered by attributes

Post by moritz »

Hi Tomok,

thanks for your reply. :)

TX_TF_RSM_Standort is not a Dimension of the cube i want to fill with data.
(I think that is the reason your snippet triggers an error. Syntax-Error)

What do you mean with "don't forget you'll need to feed Output lfd. Geschäft."?
This works fine:

Code: Select all

['Input'] = N:DB('TX_TF_RSM_OI','Input',!TX_TF_RSM_Datum,'Gesamt','Gesamt','Gesamt','Gesamt','Gesamt');
I'm not able to change the structure of the other cubes in any way. :(
"Gesamt" means all elements of the dimension consolidated.
But thanks for your info.
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: fill cube with values filtered by attributes

Post by tomok »

moritz wrote:TX_TF_RSM_Standort is not a Dimension of the cube i want to fill with data.
Then you are not going to be able to do what you want. The only way the target cube is going to be able reference the attribute for an element is if those elements actually exist in the cube, otherwise you would have to hard-code each element individually in a rule. I don't know anything about the structure of your model or the business purpose behind what you are doing so I cannot tell if this is an option or not.
moritz wrote:What do you mean with "don't forget you'll need to feed Output lfd. Geschäft."?
Read the TM1 Rules documentation, especially the section covering Feeders.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
lotsaram
MVP
Posts: 3704
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: fill cube with values filtered by attributes

Post by lotsaram »

Gruss Moritz,

TM1 OLAP is not like an RDBMS, you cannot do conditional sums based on an attribute value (conditional filtered lists driven by MDX yes but not sums unless you use additional measures.) The way this is achieved in TM1 is to use the attribute values as a reference point to build a hierarchy in the target dimension and then use the database's natural consolidation to return the sum. In this case you want to build a consolidation point called "Laufend" in the Standort dimension. This is the simplest way. Then in the cube that you wish to populate you just use DB reference to cube with RSM Standort dimension and pull value for "Laufend".

And Tomok is right, it is a bad design that is very confusing for users (even non-DAU) where top node of every dimension is named the same. Same criticism applies to a model with English nomenclature with "Total" at the top of each dimension, this is just bad practice. When looking at a crosstab or other report the user then needs to click and expand on each dimension button to see what dimension they are dealing with. This hinders users and is annoying. Much better to include a meaningful name in the top of the hierarchy that signals to the user what dimension they are looking at, z.B. "Gesamt Standorte", "Gesamt Geschäftsbereiche", "Gesamt Sparten" oder "Standorte - Gesamt", "Geschäftsbereich - Gesamt", "Sparte - Gesamt" oder "Alle Standorten", "Alle ......
you get the picture.
moritz
Posts: 15
Joined: Wed Sep 04, 2013 2:26 pm
OLAP Product: TM1
Version: 10.1.1
Excel Version: Excel 2010

Re: fill cube with values filtered by attributes

Post by moritz »

Thanks again for your answers. :)
I will definitely have a deeper look in the Guides provided by IBM.

I got it by editing the elements of the Dimension "Standort".
Some Elements are consolidated under "Gesamt>Berlin" and again under "Laufend"
I'm not sure, if its good to use it like this.

Image
Post Reply