Page 1 of 1
Parent Child Dimension
Posted: Mon Nov 11, 2013 3:58 pm
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
Re: Parent Child Dimension
Posted: Mon Nov 11, 2013 6:54 pm
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.
Re: Parent Child Dimension
Posted: Mon Nov 11, 2013 9:19 pm
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
Re: Parent Child Dimension
Posted: Mon Nov 11, 2013 9:25 pm
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
Re: Parent Child Dimension
Posted: Tue Nov 12, 2013 4:47 pm
by terryd
Did a ElementDelete in the Epilog, I guess that will do for now.
Terry
Re: Parent Child Dimension
Posted: Wed Nov 13, 2013 7:17 am
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);