Page 1 of 1

Can MDX work across alt hierarchies from one dim?

Posted: Tue Apr 23, 2024 6:01 am
by macsir
Looks like it gives me incompatible dimensionality error. Could anyone help to confirm? Thanks.
e.g. Union( [dim].[a].children, [dim].[c].children )

Re: Can MDX work across alt hierarchies from one dim?

Posted: Tue Apr 23, 2024 6:44 am
by Wim Gielis
That’s indeed incompatible. Are you not trying to make an MDX view using those 2 sets of elements (the ones that are shared) ?

Re: Can MDX work across alt hierarchies from one dim?

Posted: Tue Apr 23, 2024 7:16 am
by lotsaram
macsir wrote: Tue Apr 23, 2024 6:01 am Looks like it gives me incompatible dimensionality error. Could anyone help to confirm? Thanks.
e.g. Union( [dim].[a].children, [dim].[c].children )
This can't work by definition. The hierarchies are separate entities. No C elements are shared.

You could use Generate to loop a set on one hierarchy and return the set of leaves (or even the set of C elements sharing the same name) existing in the other hierarchy.

Re: Can MDX work across alt hierarchies from one dim?

Posted: Tue Apr 23, 2024 10:31 am
by macsir
Wim Gielis wrote: Tue Apr 23, 2024 6:44 am That’s indeed incompatible. Are you not trying to make an MDX view using those 2 sets of elements (the ones that are shared) ?
No, just want to see if it is possible in a MDX set.

Re: Can MDX work across alt hierarchies from one dim?

Posted: Tue Apr 23, 2024 10:32 am
by macsir
lotsaram wrote: Tue Apr 23, 2024 7:16 am
macsir wrote: Tue Apr 23, 2024 6:01 am Looks like it gives me incompatible dimensionality error. Could anyone help to confirm? Thanks.
e.g. Union( [dim].[a].children, [dim].[c].children )
This can't work by definition. The hierarchies are separate entities. No C elements are shared.

You could use Generate to loop a set on one hierarchy and return the set of leaves (or even the set of C elements sharing the same name) existing in the other hierarchy.
Haven't used Generate function a lot but good to know.

Re: Can MDX work across alt hierarchies from one dim?

Posted: Tue Apr 23, 2024 10:32 am
by Wim Gielis
macsir wrote: Tue Apr 23, 2024 10:31 am
Wim Gielis wrote: Tue Apr 23, 2024 6:44 am That’s indeed incompatible. Are you not trying to make an MDX view using those 2 sets of elements (the ones that are shared) ?
No, just want to see if it is possible in a MDX set.
Then the answer is no, as what Lotsa also replied.

Re: Can MDX work across alt hierarchies from one dim?

Posted: Tue Apr 23, 2024 11:50 am
by ardi
macsir wrote: Tue Apr 23, 2024 6:01 am Looks like it gives me incompatible dimensionality error. Could anyone help to confirm? Thanks.
e.g. Union( [dim].[a].children, [dim].[c].children )
Not possible, different hierarchies of a dimension are treated the same as 2 separate dimensions.

Re: Can MDX work across alt hierarchies from one dim?

Posted: Fri May 10, 2024 8:26 pm
by PavoGa
macsir wrote: Tue Apr 23, 2024 6:01 am Looks like it gives me incompatible dimensionality error. Could anyone help to confirm? Thanks.
e.g. Union( [dim].[a].children, [dim].[c].children )
What is it you are trying to accomplish exactly?

Also, the example could be confusing. From the coversation, it is assumed that a and c are separate hierarchies within the same dimension and if so, why is children used? Or are a and c consolidations within the same dimension?

Is it:

UNION( [dim1].[consolidation_a].children, [dim2].[consolidation_c].children) (not possible)

or

UNION( [dim1].[alt_hier_a].[some consol].children, [dim1].[alt_hier_c].[some aconsol].children) (pretty sure not possible either)

or

UNION( [dim1].[consolidation_a].children, [dim1].[consolidation_c].children) (yes possible)

If separate dimensions or hierarchies, you could (maybe) generate an INTERSECTION of the two sets, but not a UNION as mentioned.

NOTE; an intersection could not be created using the INTERSECTION function, but GENERATE and StrToMember nonsense and it would be tricky if possible.