Feeding via Alias?

Post Reply
User avatar
Steve Vincent
Site Admin
Posts: 1054
Joined: Mon May 12, 2008 8:33 am
OLAP Product: TM1
Version: 10.2.2 FP1
Excel Version: 2010
Location: UK

Feeding via Alias?

Post by Steve Vincent »

This one is going to take a little explaining, so please bear with me;

Examples in the attached excel file are fictitious to try and keep things simple. I have 2 cubes using similar but not the same breakdown of transport. Dim A is used in a high level cube in which people create a general plan of requirements by headcount. Dim B is more detailed and used in a different cube where each area plans their requirements to a much lower level in hours (converted by TI in to equivalent heads at a later stage).

The n levels in each dim are data entry points. There is a combination cube which uses the higher level Dim A to report data from both the high and low level cubes. It does this using a rule to pull in the data from each cube, and the low and high level cubes each have a feeder to this consolidation cube.

On Dim B, because the lowest level elements do not exist in dim A where it needs to feed to, an attribute exists to calculate the lowest parent that exists in both dims. It’s this attribute that is then used in the feeder to ensure the numbers appear in the consolidation cube correctly.

That’s the easy bit (honest!). The company being what it is cannot stick to a single naming convention or hierarchy for anything longer than 5 minutes. I wanted to recreate the structures of Dim A and Dim B in the new structures by using alias’s where the name of elements has been changed. I didn’t want to change the elements directly because then I loose any data I already have in cube A (high level one). This is where TM1 is failing me.

The rule that creates the attribute which is used in the feeder works fine with an alias. If “Planes” got an alias of “Aircraft” in both dims then the attribute picks that up no problem. What it refuses to do is feed with the alias name. The DB rule is using ! for most dims in the cube, and had it been TI the same kind of action with CellPutN would work fine with an alias. It simply will not work with the rules though, I get no numbers in the consolidation cube unless the element names match, and the alias isn’t good enough.

An example of the feeder from cube B is below;

Code: Select all

# Feed Cube C
['Actual Headcount'] =>
	DB('Cube C,'Actual Headcount',!Nomination,!Resource Source,
	attrs('DIM B',!DIM B,'DIM A LOOKUP');
If the element names are the same, this works no problem. But if one has been renamed via alias the feeder does not work and the numbers do not appear in cube C.

Should TM1 be able to feed via alias names (in the same way TI can load to alias names) in which case this seems to be a fault, or is feeding via aliases not supported?
Attachments
feeder examples.xls
examples of a dim layout of the type causing my issues
(21.5 KiB) Downloaded 318 times
If this were a dictatorship, it would be a heck of a lot easier, just so long as I'm the dictator.
Production: Planning Analytics 64 bit 2.0.5, Windows 2016 Server. Excel 2016, IE11 for t'internet
User avatar
Steve Rowe
Site Admin
Posts: 2455
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

Re: Feeding via Alias?

Post by Steve Rowe »

I'm not sure if alias in feeders work, not something I have ever tried to do to be honest.

Does "attrs('DIM B',!DIM B,'DIM A LOOKUP')" contain the value of an alias in Dim A or the element code in Dim A, if you already have the alias I would have thought a simple change to the rule would convert it to the element name?

One tip for performance is to use a TI to read the rule created attribute into a static attribute. TM1 doesn't cache strings so you should see a performance gain as currently TM1 is evaluating the atrr rule everytime the feeder fires.
HTH?
Technical Director
www.infocat.co.uk
User avatar
Martin Ryan
Site Admin
Posts: 1989
Joined: Sat May 10, 2008 9:08 am
OLAP Product: TM1
Version: 10.1
Excel Version: 2010
Location: Wellington, New Zealand
Contact:

Re: Feeding via Alias?

Post by Martin Ryan »

No I haven't tried it either, but I'd have expected it to work as there are no problems with writing a rule for an alias.

As a work around, what about making the final element
dimnm('Dim A', dimix('Dim A', attrs('DIM B',!DIM B,'DIM A LOOKUP')));

which will (should) convert the alias into the element name.

Martin
Please do not send technical questions via private message or email. Post them in the forum where you'll probably get a faster reply, and everyone can benefit from the answers.
Jodi Ryan Family Lawyer
glaurens
Posts: 45
Joined: Thu Jan 08, 2009 3:42 pm

Re: Feeding via Alias?

Post by glaurens »

Feeding via aliases definitely works but what you need to do, is to specify it on the right-hand side, i.e.

[] => DB('cons cube', !dim1, !dim2, ATTRS('dim B', !dim B, 'Dim A Attr'), ...)

This will ensure that the element feeds its alias in the consolidated cube, and if the alias exists in Dim A, it will definitely work.

G
User avatar
Steve Vincent
Site Admin
Posts: 1054
Joined: Mon May 12, 2008 8:33 am
OLAP Product: TM1
Version: 10.2.2 FP1
Excel Version: 2010
Location: UK

Re: Feeding via Alias?

Post by Steve Vincent »

glaurens, thats the problem. i'm using exactly that notation and it doesn't work. the example is vastly oversimplified compared to my real life model, but the data is sensitive so i'm not willing to post it here. What's making this difficult is i have a mix of renamed (via alias) elements and others that have not moved. My attribute rule really needs to pull thru the alias name because people use it for other things in reports, but unlike in the subset editor when no alias is present it'll show the element name, using ATTRS pulls thru a blank value.

Now i *could* use an IF to look at the value, if blank use the element and if not use the alias, but when you see the current code that is creating this attribute i think you might see why i'm struggling... :o

Code: Select all

['ValidEntry']=S:
	IF(dimix('Ops Plan RBS',!Resource Breakdown)>0,attrs('Resource Breakdown',!Resource Breakdown,'Tag & Description'),
	IF(attrs('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,1),'MainHierarchyMarker') @='Y',
		IF(dimix('Ops Plan RBS',ELPAR('Resource Breakdown',!Resource Breakdown,1))>0,
              attrs('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,1),'Tag & Description'),
              IF(dimix('Ops Plan RBS',ELPAR('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,1),1))>0,
                            attrs('Resource Breakdown',ELPAR('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,1),1),'Tag & Description'),
              IF(dimix('Ops Plan RBS',ELPAR('Resource Breakdown',ELPAR('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,1),1),1))>0,
                            attrs('Resource Breakdown',ELPAR('Resource Breakdown',ELPAR('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,1),1),1),'Tag & Description'),
                            CONTINUE ))),
	IF(attrs('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,2),'MainHierarchyMarker') @='Y',
		IF(dimix('Ops Plan RBS',ELPAR('Resource Breakdown',!Resource Breakdown,2))>0,
			attrs('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,2),'Tag & Description'),
			CONTINUE ),
	IF(attrs('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,3),'MainHierarchyMarker') @='Y',
		IF(dimix('Ops Plan RBS',ELPAR('Resource Breakdown',!Resource Breakdown,3))>0,
			attrs('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,3),'Tag & Description'),
			CONTINUE ),
	IF(attrs('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,4),'MainHierarchyMarker') @='Y',
		IF(dimix('Ops Plan RBS',ELPAR('Resource Breakdown',!Resource Breakdown,4))>0,
			attrs('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,4),'Tag & Description'),
			CONTINUE ),
	IF(attrs('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,5),'MainHierarchyMarker') @='Y',
		IF(dimix('Ops Plan RBS',ELPAR('Resource Breakdown',!Resource Breakdown,5))>0,
			attrs('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,5),'Tag & Description'),
			CONTINUE ),
	'ERROR CALC OPS PLAN EQUIV'
	))))));

I think i'm going to look at breaking this all down in to multiple "['ValidEntry'] = " sections because my head is now starting to hurt!
If this were a dictatorship, it would be a heck of a lot easier, just so long as I'm the dictator.
Production: Planning Analytics 64 bit 2.0.5, Windows 2016 Server. Excel 2016, IE11 for t'internet
glaurens
Posts: 45
Joined: Thu Jan 08, 2009 3:42 pm

Re: Feeding via Alias?

Post by glaurens »

Hi Steve,

What I would do to simplify this, is to write 2 feeders, one to the element and one to the attribute. This will not cause the cube to be bigger but it will take a bit longer to save the rules. The other alternative is to create an attribute which looks at your monster attribute, and if it is blank, get the element name, else take the attribute.

George
User avatar
Steve Vincent
Site Admin
Posts: 1054
Joined: Mon May 12, 2008 8:33 am
OLAP Product: TM1
Version: 10.2.2 FP1
Excel Version: 2010
Location: UK

Re: Feeding via Alias?

Post by Steve Vincent »

i needed the attribute to pick up the alias where there was one anyway, so i think i've finally sussed it. Can't say it's the prettiest bit of code ever but so far it's doing the job;

Code: Select all


#FIND VALID RBS EQUIV IF THEY EXIST IN BOTH STRUCTURES
['ValidEntry']=S:
	IF(dimix('Ops Plan RBS',!Resource Breakdown)>0,
		IF( attrs('Resource Breakdown',!Resource Breakdown,'Tag & Description') @='',
			!Resource Breakdown,
			attrs('Resource Breakdown',!Resource Breakdown,'Tag & Description')),
		CONTINUE );

#1ST PARENT CHECK
['ValidEntry']=S:
	IF(attrs('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,1),'MainHierarchyMarker') @='Y',
		IF(dimix('Ops Plan RBS',ELPAR('Resource Breakdown',!Resource Breakdown,1))>0,
			IF(attrs('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,1),'Tag & Description') @='',
				ELPAR('Resource Breakdown',!Resource Breakdown,1),
				attrs('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,1),'Tag & Description')),
			CONTINUE ),
	CONTINUE);

#1ST GRANDPARENT CHECK
['ValidEntry']=S:
	IF(attrs('Resource Breakdown',ELPAR('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,1),1),'MainHierarchyMarker') @='Y',
		IF(dimix('Ops Plan RBS',ELPAR('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,1),1))>0,
			IF(attrs('Resource Breakdown',ELPAR('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,1),1),'Tag & Description') @='',
				ELPAR('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,1),1),
				attrs('Resource Breakdown',ELPAR('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,1),1),'Tag & Description')),
			CONTINUE ),
	CONTINUE);

#1ST GREAT GRAND PARENT CHECK
['ValidEntry']=S:
	IF(attrs('Resource Breakdown',ELPAR('Resource Breakdown',ELPAR('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,1),1),1),'MainHierarchyMarker') @='Y',
		IF(dimix('Ops Plan RBS',ELPAR('Resource Breakdown',ELPAR('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,1),1),1))>0,
			IF(attrs('Resource Breakdown',ELPAR('Resource Breakdown',ELPAR('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,1),1),1),'Tag & Description') @='',
				ELPAR('Resource Breakdown',ELPAR('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,1),1),1),
				attrs('Resource Breakdown',ELPAR('Resource Breakdown',ELPAR('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,1),1),1),'Tag & Description')),
			CONTINUE ),
	CONTINUE);


#2ND PARENT CHECK
['ValidEntry']=S:
	IF(attrs('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,2),'MainHierarchyMarker') @='Y',
		IF(dimix('Ops Plan RBS',ELPAR('Resource Breakdown',!Resource Breakdown,2))>0,
			IF(attrs('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,2),'Tag & Description') @='',
				ELPAR('Resource Breakdown',!Resource Breakdown,2),
				attrs('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,2),'Tag & Description')),
			CONTINUE ),
	CONTINUE);

#3RD PARENT CHECK
['ValidEntry']=S:
	IF(attrs('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,3),'MainHierarchyMarker') @='Y',
		IF(dimix('Ops Plan RBS',ELPAR('Resource Breakdown',!Resource Breakdown,3))>0,
			IF(attrs('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,3),'Tag & Description') @='',
				ELPAR('Resource Breakdown',!Resource Breakdown,3),
				attrs('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,3),'Tag & Description')),
			CONTINUE ),
	CONTINUE);

#4TH PARENT CHECK
['ValidEntry']=S:
	IF(attrs('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,4),'MainHierarchyMarker') @='Y',
		IF(dimix('Ops Plan RBS',ELPAR('Resource Breakdown',!Resource Breakdown,4))>0,
			IF(attrs('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,4),'Tag & Description') @='',
				ELPAR('Resource Breakdown',!Resource Breakdown,4),
				attrs('Resource Breakdown',ELPAR('Resource Breakdown',!Resource Breakdown,4),'Tag & Description')),
			CONTINUE ),
	CONTINUE);

Made difficult by multiple hierarchies and the fact that the }ElementAttributes cube only holds a value for the alias if it's different to the element.
If this were a dictatorship, it would be a heck of a lot easier, just so long as I'm the dictator.
Production: Planning Analytics 64 bit 2.0.5, Windows 2016 Server. Excel 2016, IE11 for t'internet
Post Reply