Page 1 of 1
ATTRS in rules
Posted: Fri Jul 13, 2012 11:22 am
by carsten
Hi I'm trying to build a rule from a e.g. 2 dimensional cube
Cube1:
Dimension 1
dimension 2 (This has an attribute = "dimension3attribute"
to a cube with 3 dimension
Cube2:
Dimension1
dimension2
dimension3
as followed
[] = N: DB('Cube1',!Dimension1,!Dimension2, attrs('Dimension3', !Dimension3, 'Dimension3Attribute');
But htis is not working ? Is this generally possible to build?
Thx
Carsten
Re: ATTRS in rules
Posted: Fri Jul 13, 2012 11:34 am
by declanr
The DB statement is referencing CUBE 1 which has 2 dimensions but you have tried to put 3 qualifiers in it.
Since Cube 2 has the extra dimension you will need to put something on the left e.g.
['dim 3 element']=N: DB('Cube 1', !Dim 1, !Dim 2);
Since you seem to be wanting to do something where the attributes of Dimension 2 are the elements of Dimension 3, you will possibly need to build consolidations into Dimension 2 instead of (or in addition to) the attributes...
Can you provide more detail of exactly what you are trying to do?
Edit - with the consolidations you could then do:
[]=N: DB('Cube 1', !Dim1, !Dim3); .... since the elements of Dim 3 will be the consolidations in Dim2
Re: ATTRS in rules
Posted: Fri Jul 13, 2012 11:44 am
by carsten
thx for answering
i want to make a 2 dimensional cube to a 3 dimensional cube. And the 3rd dimension is an attribute of Cube1 (or dimension2)
Re: ATTRS in rules
Posted: Fri Jul 13, 2012 11:49 am
by declanr
I was meaning a bit more detail about the cubes/dimensions/elements... anyways...
Create a TI that cycles through dimension 2 and adds the N-Level elements under consolidated elements created from the N-Level element's attributes.
Then use the line in the rule of cube 2 that I posted above e.g. []=N: DB('Cube1', !Dim1, !Dim3);
Re: ATTRS in rules
Posted: Fri Jul 13, 2012 12:26 pm
by rozef
I think what carsten expect is:
[] = N: IF( attrs('Dimension2', !Dimension2, 'Dimension3Attribute') @= !Dimension3,
DB('Cube1',!Dimension1,!Dimension2 ),
Continue );
Depending if your attribute is on dimension 2 or 3, you should maybe reverse the IF statement.
Re: ATTRS in rules
Posted: Fri Jul 13, 2012 12:31 pm
by declanr
rozef wrote:I think what carsten expect is:
[] = N: IF( attrs('Dimension2', !Dimension2, 'Dimension3Attribute') @= !Dimension3,
DB('Cube1',!Dimension1,!Dimension2 ),
Continue );
Depending if your attribute is on dimension 2 or 3, you should maybe reverse the IF statement.
Ah I see what it is that was wanted now.
But why would you do this, since the 3rd dimension is the attribute of the 2nd you will never have anything from dimension 2 appearing in more than one element from dimension 3?
Re: ATTRS in rules
Posted: Fri Jul 13, 2012 1:20 pm
by tomok
declanr wrote:But why would you do this, since the 3rd dimension is the attribute of the 2nd you will never have anything from dimension 2 appearing in more than one element from dimension 3?
From this particular rule, yes. Perhaps there will be other rules to populate other elements of dimension3 or maybe he will load data into those other elements.
Re: ATTRS in rules
Posted: Fri Jul 13, 2012 1:25 pm
by declanr
tomok wrote:declanr wrote:But why would you do this, since the 3rd dimension is the attribute of the 2nd you will never have anything from dimension 2 appearing in more than one element from dimension 3?
From this particular rule, yes. Perhaps there will be other rules to populate other elements of dimension3 or maybe he will load data into those other elements.
If that is the case then great but the []= suggests that it will be entirely populated from "Cube 1".
I should have worded my last post better but was trying to see if the OP understands the concepts of where it is most suitable to use attributes vs extra dimensionality.
Re: ATTRS in rules
Posted: Fri Jul 13, 2012 1:30 pm
by rozef
Maybe it was just an example. I already saw this kind of rules to retrieve operationnal data into different cnosolidation.
For exemple a duration indicator transposed into a time hierarchy.
Re: ATTRS in rules
Posted: Mon Jul 16, 2012 11:12 am
by carsten
declanr wrote:rozef wrote:I think what carsten expect is:
[] = N: IF( attrs('Dimension2', !Dimension2, 'Dimension3Attribute') @= !Dimension3,
DB('Cube1',!Dimension1,!Dimension2 ),
Continue );
Depending if your attribute is on dimension 2 or 3, you should maybe reverse the IF statement.
Ah I see what it is that was wanted now.
But why would you do this, since the 3rd dimension is the attribute of the 2nd you will never have anything from dimension 2 appearing in more than one element from dimension 3?
Thanks this is exactly what i needed. Its working fine.