Page 1 of 1

Element-ghost

Posted: Mon Jul 27, 2015 7:32 pm
by vovanenok
Hi all!

I have a really strange issue. First of all, I'm not the original developer of the current system.
In Cost Element dimension I have one consolidated element ("Total Sal&Ben&Labor&AL&TOIL") which is fully "non-working", I cannot find it using a wildcard search, DIMIX, ELLEV return 0 for that element.
The next MDX returns its children instead of the element itself:
[Cost Element].[Total Sal&Ben&Labor&AL&TOIL]

I even do not see it when I click "subset all" button in a subset editor. I even don't get it when I just loop all the dimension elements and output to a text file.
DIMSIZ function returns 1815, when I see in subset editor that element has index 1829

The only way how I select that element in subset is just by copying its name to a clipboard and pasting it in a subset editor.
As I said before If I try to use that element in TI I get an error that element doesn't exist.
I'm able to see the data in a cube viewer for that element but I cannot export it.

I have a process which generates DimensionElementInsert statements. So I created a process which for Cost Element first deletes all the elements and then runs those DimensionElementInsert to insert the elements back.
But after I run it, the element-ghost is still there.

Has anybody had anything similar? What did you do?

Re: Element-ghost

Posted: Mon Jul 27, 2015 8:03 pm
by vovanenok
That element is even deathless. Copied the dimension to a test environment. Run DimensionDeleteAllELements. All elements deleted... except the "Element-ghost"

Re: Element-ghost

Posted: Mon Jul 27, 2015 8:08 pm
by vovanenok
After deleting all the subsets of that dim, Element-ghost disappeared

Re: Element-ghost

Posted: Mon Jul 27, 2015 8:58 pm
by lotsaram
vovanenok wrote:After deleting all the subsets of that dim, Element-ghost disappeared
That's because your mystery element was not a "ghost" of an element it was a subset.

Exactly what subsets are and how they are defined technically in TM1 is a little tricky (and not at all documented so your confusion is forgiven.) Subsets are more than just lists of elements, subsets also exist as "pseudo elements" in that 1/ if a subset name is used as an argument to a DBRW then the sum of all the elements in the subset is returned, this is useful as subsets can be used as custom consolidations and user-defined consolidations. 2/ If a subset name is passed as the element argument into DIMIX then an index is returned greater than the DIMSIZ of the dimension. 3/ and lease surprisingly if {[dimension].[subset]} is used in an MDX set expression then the list of elements in the subset it returned.

If a subset name is the same as an element name then the element takes priority, but still it is always better to ensure that subsets don't share a name with any elements to save extra confusion.

But now you know :)

Re: Element-ghost

Posted: Mon Jul 27, 2015 9:17 pm
by vovanenok
Hi lotsaram
Thanks for such comprehensive reply. I knew about selecting elements from another subset using {[dimension].[subset]} but everything else was quite new and very useful

Re: Element-ghost

Posted: Mon Jul 27, 2015 11:29 pm
by Alan Kirk
lotsaram wrote:Exactly what subsets are and how they are defined technically in TM1 is a little tricky (and not at all documented so your confusion is forgiven.)
Indeed. I don't know how frequently this comes up but it's more than a one off. This is as good an explanation as I've ever seen of it so it's been added to the FAQ thread.

Re: Element-ghost

Posted: Tue Jul 28, 2015 12:36 am
by hyunjia
Thanks for the explanation , however, I could verify on point 1 and 3 but not the second point . E.g. DIMIX ( 'Year' , 'Default' ) would still give 0 . Could you elaborate more in that scenario ? I am using 10.2.2 for testing. Thanks in advance :?:


lotsaram wrote:
vovanenok wrote:After deleting all the subsets of that dim, Element-ghost disappeared
That's because your mystery element was not a "ghost" of an element it was a subset.

2/ If a subset name is passed as the element argument into DIMIX then an index is returned greater than the DIMSIZ of the dimension.

Re: Element-ghost

Posted: Tue Jul 28, 2015 2:12 pm
by vovanenok
hyunjia wrote:Thanks for the explanation , however, I could verify on point 1 and 3 but not the second point . E.g. DIMIX ( 'Year' , 'Default' ) would still give 0 . Could you elaborate more in that scenario ? I am using 10.2.2 for testing. Thanks in advance :?:
Yes, that's true, if you are using it in any function, it behaves like that element doesn't exist, i.e. DIMIX returns "0". But if you insert that element in a subset editor, it will show the index greater than dimension elements number

Re: Element-ghost

Posted: Thu Jul 30, 2015 1:07 am
by hyunjia
I get what you mean now , this is really handy feature really . I can't understand why the document doesn't empathize on that :o

Re: Element-ghost

Posted: Thu Jul 30, 2015 7:31 am
by rmackenzie
lotsaram wrote:... if {[dimension].[subset]} is used in an MDX set expression then the list of elements in the subset it returned.
You can use TM1SubsetToSet to code around the ambiguity generated by this idiosyncrasy, e.g.:

Code: Select all

{ TM1SubsetToSet ( [DIMENSION_NAME], "SUBSET_NAME" ) }