Remove duplicate elements in MDX subset build
Posted: Tue May 23, 2023 8:21 pm
Hi all,
I am trying to build an MDX subset in the following way. I want 'Jan Forecast' and 'Mar Forecast' always included in the subset. 'PriorMonthSnapshot_1' refers to a snapshot taken 2 months ago and 'PriorMonthSnapshot_2' refers to a snapshot taken 3 months ago. There is a chance that the elements can get duplicated and I want to remove the dupes. Can someone help me? Any ideas???
Here's part of the code:
Thanks,
Paul.
I am trying to build an MDX subset in the following way. I want 'Jan Forecast' and 'Mar Forecast' always included in the subset. 'PriorMonthSnapshot_1' refers to a snapshot taken 2 months ago and 'PriorMonthSnapshot_2' refers to a snapshot taken 3 months ago. There is a chance that the elements can get duplicated and I want to remove the dupes. Can someone help me? Any ideas???
Here's part of the code:
Code: Select all
ElseIf (DimName @= 'Versions' );
SubsetCreate(dDimName,sSubName);
SubsetElementInsert(dDimName,sSubName, 'Planning', 1);
SubsetElementInsert(dDimName,sSubName, 'Budget', 1);
SubsetElementInsert(dDimName,sSubName, PriorMonthForecast, 1);
SubsetElementInsert(dDimName,sSubName,'Jan Forecast',1);
SubsetElementInsert(dDimName,sSubName,'Mar Forecast',1);
SubsetElementInsert(dDimName,sSubName,PriorMonthSnapshot_1,1);
SubsetElementInsert(dDimName,sSubName, PriorMonthSnapshot_2,1);
EndIf;
Paul.