Page 1 of 1

Static Subset use

Posted: Mon Jun 29, 2015 1:33 pm
by Moh
Hello Sir,I have a doubt we take dynamic subset as source using mdx and then make it static mdx by adding and removing an element.why don't we take static subset when we start with in prolog.is there any advantage by this method,thanks for clarifying my doubt.

Re: Static Subset use

Posted: Mon Jun 29, 2015 2:00 pm
by qml
The advantege to using this technique is that you can achieve quite a lot with an MDX formula and it can be quite convenient and quick. Turning a dynamic subset to a static one has the advantage of the subset not having to be recalculated on subsequent reads from the subset (also, depending on your TM1 version object locking can be a problem with dynamic subsets). If you have another easy, quick and convenient method for creating that static subset that you want, by all means use it.

Re: Static Subset use

Posted: Mon Jun 29, 2015 3:25 pm
by Moh
Thank you.But I have another doubt suppose we write dynamic subset first in prolog using mdx and then make it static doesn't the code for dynamic executed before going to static subset,so it wouldn't anyway get evaluated.

Re: Static Subset use

Posted: Mon Jun 29, 2015 3:40 pm
by qml
Moh wrote:Thank you.But I have another doubt suppose we write dynamic subset first in prolog using mdx and then make it static doesn't the code for dynamic executed before going to static subset,so it wouldn't anyway get evaluated.
I'm sorry, but I don't understand. Could you rephrase your question?

Re: Static Subset use

Posted: Mon Jun 29, 2015 3:52 pm
by Moh
sorry,I will try.what I am trying to say if we write code subsetcreatebymdx(expression) and then make this mdx static by adding and removing the element,the order of execusion will be subsetcreatebymdx(expression) then
subsetelementinsert and subsetelementdelete.Anyway first subsetcreatebymdx(expression) latter other two.
How does it stop evaluating first line subsetcreatebymdx(expression).

Re: Static Subset use

Posted: Mon Jun 29, 2015 4:32 pm
by qml
Moh wrote:How does it stop evaluating first line subsetcreatebymdx(expression).
It doesn't. You want it to be evaluated to get the list of elements defined by your MDX. Then you add and remove a dummy element as a trick to implicitly change it to a static subset that still contains the same elements originally defined by your MDX.

These days, if you're on at least version 10.2.2, you can also use the new function SubsetMDXSet( dim, subset, [mdx] ) to the same effect, no need for dummy operations anymore.

Re: Static Subset use

Posted: Wed Jul 01, 2015 6:38 am
by Moh
I understand now.Thank you.