Product:
IBM Cognos Tm1 10.2.2 fix pack 4
Issue:
Try to create a subset and get an error when run the TM1 TI process.
Process will set READ on selected DIMENSIONS for a defined AD group.
Error message:
Error: Prolog procedure line (67): Unable to register subset
Possible solution:
Missing last parameter in function, which should add all dimensions that start with S2 in name to subset.
SubsetCreatebyMDX ( sSubset , ‘{TM1FILTERBYPATTERN( {TM1SubsetALL( [ ‘| sDim |’ ] )}, “S2.*” )}’ ,1);
Was missing last 1.
The function add the values that should be part of the subset
SubsetElementInsert(DimName, SubName, ElName, Position);
The variables are declared before with
sDim=’}Dimensions’;
sName = ‘$.’| GetProcessName();
sSubset=sName|sDim;
More info ( full prolog ):
#****Begin: Generated Statements***
#****End: Generated Statements****
sSecurityCube = ‘}DimensionSecurity’;
#———————————————————————————–
# to add ” in the string you need a variable
# more info: http://www.robelle.com/smugbook/ascii.html
#———————————————————————————–
q=char(34);
#—————————————————————————————–
# create the view as a static public view: CUBESEC
#—————————————————————————————
pFromCube = sSecurityCube;
SourceView= pFromCube | ‘CUBESEC’;
#——————————————————————
# Create views
#———————————————————————
if(ViewExists(pFromCube, SourceView)=1);
viewDestroy(pFromCube, SourceView);
endif;
viewCreate(pFromCube, SourceView);
#——————————————————————
# Define variables
#———————————————————————
sBIgroup = ‘CAMID(“:LDAP:Cognos_FAP_Users”)’;
sSecutiryAction = ‘READ’;
sDim=’}Dimensions’;
sName = ‘$.’| GetProcessName();
sSubset=sName|sDim;
#———————————————————————————–
# If subset exist then it is destroyed before created
#———————————————————————————-
if(subsetExists(sDim,sSubset)= 1);
subsetDeleteAllElements(sDim, sSubset);
else;
subsetCreate(sDim, sSubset);
endif;
#——————————————————————————————————————
# add the values that should be part of the subset
# SubsetElementInsert(DimName, SubName, ElName, Position);
# should be all dim that start with S2, so a MDX look like this
# {TM1FILTERBYPATTERN( {TM1SubsetBasis()}, “S2.*”)}
#———————————————————————————————–
SubsetCreatebyMDX ( sSubset , ‘{TM1FILTERBYPATTERN( {TM1SubsetALL( [ ‘| sDim |’ ] )}, “S2.*” )}’ ,1);
#——————————————————
# add subset to view
#——————————————————-
ViewSubsetAssign(pFromCube, SourceView, sDim, sSubset);
#——————————————————————————-
# Set source – we only use subset in dim
#——————————————————————————–
DataSourceType=’SUBSET’;
DataSourceNameForServer= sDim;
DatasourceDimensionSubset= sSubSet ;
#————————————————————————————————–
i=1;
G2 = SubsetGetSize( sDim, sSubSet);
while (i <= G2);
G1= ( SubsetGetElementName ( sDim, sSubSet, I));
cellputs ( sSecutiryAction , sSecurityCube, G1 , sBIgroup );
i=i+1;
end;
#—————————————————————————–
# end of code
#—————————————————————————–
Epilog should have some clean up code like this:
if (ViewExists(pFromCube, SourceView)=1);
viewDestroy(pFromCube, SourceView);
endif;
#———————————————
# destroy temp subset
#———————————————
sDim=’}Cubes’;
sName = ‘$.’| GetProcessName();
sSubset=sName|sDim;
subsetDestroy(sDim, sSubset);