Parent Child Dimension

Post Reply
terryd
Posts: 3
Joined: Thu Nov 07, 2013 8:27 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2010

Parent Child Dimension

Post by terryd »

Hi All,

I am trying to load a dimension with parent child hierarchy as such:
  • Child Parent
    ALL
    Asia Pacific ALL
    Central Europe ALL
    North America ALL
This is what I get when I load it into Architect using TI, since the Parent of "ALL" is Blank, I get a # sign.
  • #
    ALL
    Asia Pacific
    Central Europe
    North America
Any idea how to get rid of the "#" on top of the hierarchy? I must keep the ALL row in my dimension data since I am using a star schema.
Any help is much appreciated!

Regards,

Terry
Alan Kirk
Site Admin
Posts: 6667
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: Parent Child Dimension

Post by Alan Kirk »

terryd wrote:Hi All,

I am trying to load a dimension with parent child hierarchy as such:
  • Child Parent
    ALL
    Asia Pacific ALL
    Central Europe ALL
    North America ALL
This is what I get when I load it into Architect using TI, since the Parent of "ALL" is Blank, I get a # sign.
  • #
    ALL
    Asia Pacific
    Central Europe
    North America
Any idea how to get rid of the "#" on top of the hierarchy? I must keep the ALL row in my dimension data since I am using a star schema.
Any help is much appreciated!
It would be useful to see the actual code relating to this process.

However I suggest that you also double check your data source content for I do not think it is what you think it is. Specifically I doubt that the parent element of All is in fact shown as an empty string.

The reason is that if you use the DimensionElementComponentAdd function with an empty string as the parent element then you won't have a consolidation named "#" automagically entered and used as the parent; instead the function will simply return a minor error along the lines of:

Code: Select all

Error: Prolog procedure line (n): Consolidated Element "" not found.
This suggests that your data source is in fact sending "#" as the parent element. (Or that you're generating this with Performance Muddler and it's doing something idiotic like writing a line of code to treat empty strings as "#", which is again why it would be useful to see the actual code. Having an allergy to both auto-generated code in general and Performance Muddler in particular I don't know what that thing might or might not be doing if you rely on its little GUI wizard to generate your code. Which you shouldn't.)

In any case, the solution is essentially the same; you just skip over adding the child element if the parent is "#" or an empty string.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
User avatar
Michel Zijlema
Site Admin
Posts: 713
Joined: Wed May 14, 2008 5:22 am
OLAP Product: TM1, PALO
Version: both 2.5 and higher
Excel Version: 2003-2007-2010
Location: Netherlands
Contact:

Re: Parent Child Dimension

Post by Michel Zijlema »

Alan Kirk wrote:This suggests that your data source is in fact sending "#" as the parent element. (Or that you're generating this with Performance Muddler and it's doing something idiotic like writing a line of code to treat empty strings as "#", which is again why it would be useful to see the actual code. Having an allergy to both auto-generated code in general and Performance Muddler in particular I don't know what that thing might or might not be doing if you rely on its little GUI wizard to generate your code. Which you shouldn't.)

In any case, the solution is essentially the same; you just skip over adding the child element if the parent is "#" or an empty string.
Or you're using package connector - which indeed replaces NULLs by the hash symbol.

Michel
terryd
Posts: 3
Joined: Thu Nov 07, 2013 8:27 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2010

Re: Parent Child Dimension

Post by terryd »

Michel Zijlema wrote:
Alan Kirk wrote:This suggests that your data source is in fact sending "#" as the parent element. (Or that you're generating this with Performance Muddler and it's doing something idiotic like writing a line of code to treat empty strings as "#", which is again why it would be useful to see the actual code. Having an allergy to both auto-generated code in general and Performance Muddler in particular I don't know what that thing might or might not be doing if you rely on its little GUI wizard to generate your code. Which you shouldn't.)

In any case, the solution is essentially the same; you just skip over adding the child element if the parent is "#" or an empty string.
Or you're using package connector - which indeed replaces NULLs by the hash symbol.

Michel
Thanks guys for all your input. Yes, I am indeed using package connector, Whats your suggested method of removing this? what would be the approach to "you just skip over adding the child element if the parent is "#" or an empty string"

Thanks Again,

Terry
terryd
Posts: 3
Joined: Thu Nov 07, 2013 8:27 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2010

Re: Parent Child Dimension

Post by terryd »

Did a ElementDelete in the Epilog, I guess that will do for now.

Terry
User avatar
Martin Ryan
Site Admin
Posts: 2003
Joined: Sat May 10, 2008 9:08 am
OLAP Product: TM1
Version: 10.1
Excel Version: 2010
Location: Wellington, New Zealand
Contact:

Re: Parent Child Dimension

Post by Martin Ryan »

terryd wrote: what would be the approach to "you just skip over adding the child element if the parent is "#" or an empty string"
In pseudo code you'll need

Code: Select all

insert child to dimension
if sParent='' then
  do nothing
else
  insert parent to dimension
  create parent child relationship
end if
You'll want functions like dimensionelementcomponentadd and dimensionelementinsert. When comparing strings you use the @ symbol. E.g. if(string1@=string2);
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
Post Reply