Create views/subsets dynamically in a CONTROL object
Posted: Sat Nov 09, 2019 7:12 pm
Hello,
I came across a TI that dynamically creates a view after a bunch of dimensioncreatebyMDX, subsetelementinsert, viewsubsetassign and finally using this newly created view as data source (then copy the data in this view to a target view in data). I understand everything except the part that it created the view using control objects as below:
View_name = ‘}copy_scenario’;
Sub_name = ‘}FromScenario’;
I’m not too familiar with control cubes, can someone please let me know why it uses control objects instead of just creating a normal view in that cube?
Also where the TI tests if a subset exists, if it does, delete all elements in it, if does not, create it. The codes are like:
If subsetexists(Dim, Sub)=1;
Subsetdeleteallelements(dim, sub);
Else
Subserdestroy(dim, sub);
Subsetcreate(dim, sub);
Endif;
The part I don’t understand is that if the sub doesn’t exist, why it needs to be destroyed (the else part), is the destroy part necessary here??
Thanks!
I came across a TI that dynamically creates a view after a bunch of dimensioncreatebyMDX, subsetelementinsert, viewsubsetassign and finally using this newly created view as data source (then copy the data in this view to a target view in data). I understand everything except the part that it created the view using control objects as below:
View_name = ‘}copy_scenario’;
Sub_name = ‘}FromScenario’;
I’m not too familiar with control cubes, can someone please let me know why it uses control objects instead of just creating a normal view in that cube?
Also where the TI tests if a subset exists, if it does, delete all elements in it, if does not, create it. The codes are like:
If subsetexists(Dim, Sub)=1;
Subsetdeleteallelements(dim, sub);
Else
Subserdestroy(dim, sub);
Subsetcreate(dim, sub);
Endif;
The part I don’t understand is that if the sub doesn’t exist, why it needs to be destroyed (the else part), is the destroy part necessary here??
Thanks!