Page 1 of 1

Question about DB

Posted: Tue Nov 19, 2013 7:01 pm
by Kazêh
hello everyone,
quick question about DB functions:

is it posible to select many members from a dimension in a DB funciont? ..something like this : DB(' Cube Name', !dim1, !dim2, 'dim3':{'element1', 'element2'....etc);
i know you can select many members in the source cube with this:
['Dimension': {'Elem1', 'Elem2','...'] = N: ......

but i dont know about DB functions, im looking at the manuals right know, but if somebody know if is posible i woulb be grateful if you tell me.
So i will leave this here just in case, and continue my reaserch . i will post the answer if i find it.

Thanks for any help or tips.

Re: Question about DB

Posted: Tue Nov 19, 2013 7:12 pm
by tomok
Kazêh wrote:hello everyone,
quick question about DB functions:

is it posible to select many members from a dimension in a DB funciont? ..something like this : DB(' Cube Name', !dim1, !dim2, 'dim3':{'element1', 'element2'....etc);
i know you can select many members in the source cube with this:
['Dimension': {'Elem1', 'Elem2','...'] = N: ......

but i dont know about DB functions, im looking at the manuals right know, but if somebody know if is posible i woulb be grateful if you tell me.
So i will leave this here just in case, and continue my reaserch . i will post the answer if i find it.

Thanks for any help or tips.
You must supply one, and only one, element form each dimension in the DB function.

Re: Question about DB

Posted: Tue Nov 19, 2013 7:13 pm
by Kazêh
thanks tomok for the quick reply

Re: Question about DB

Posted: Tue Nov 19, 2013 9:34 pm
by EvgenyT
You must supply one, and only one, element form each dimension in the DB function
Or if you are looking to get a value of several element, you can reference a consolidation...like....DB(' Cube Name', !dim1, !dim2, 'Consolidation Example'...etc);

Thanks

ET

Re: Question about DB

Posted: Mon Dec 02, 2013 9:15 am
by asj105
Kazêh wrote:is it posible to select many members from a dimension in a DB funciont? ..something like this : DB(' Cube Name', !dim1, !dim2, 'dim3':{'element1', 'element2'....etc);
i know you can select many members in the source cube with this:
['Dimension': {'Elem1', 'Elem2','...'] = N: ......
You can select multiple elements in DB provided those are matching elements for you left side selection of Formula, for that you need to give !Dimensionname instead of single element from that particular dimension.
for e.g.
['Dimension': {'Elem1', 'Elem2','...'] = N: ......DB(' Cube Name', !dim1, !dim2,!Dimension);

provided Elem1, Elem2 are the members of Target Cubes dimension.

Re: Question about DB

Posted: Mon Dec 02, 2013 1:38 pm
by Duncan P
It helps to understand if you have a different perspective on the rule statement.

The statement is in two parts, separated by the equal sign (=). The left side is the area of applicability and the right side is the definition expression.

The area is specified by a number of elements in each dimension. If none are specified for a given dimension then all are assumed. This specifies a "hyper-rectangular" region (think "rectangle" in however many dimensions the cube has) for each cell of which the value is given by executing the definition expression in the context of that cell. This context means that anywhere it meets !dimension_name it will substitute the name of the element on that dimension of the cell being calculated. The result of executing the definition expression is the "value" of that cell.

If a cell happens to be in two or more areas then TM1 uses the definition to the right of the first one it finds (working from the top). Only if in executing the expression it comes across the word CONTINUE will it stop executing that expression and look for the cell in areas further down. If it finds another match then it will execute its definition expression and use that value.

The execution is in response to a request for the value of one cell. Thus it can only return one value and each part of it can also return only one value. If more than one cell is requested (by a view for example) this process is done separately for each cell requested.

Sorry about the over-use of emphasis.

Re: Question about DB

Posted: Mon Dec 02, 2013 5:29 pm
by Kazêh
Sorry about the over-use of emphasis.
it's ok, i guess. thanks for all the tips everyone.
Kazeh. ;)