I have a Cube with 2 Dimensions TextRange, TextAnalysis and TextFrequency
I am using Version 9.5.2 TM1 perspectives.
Under Text Range i have 23 Elements which i created Manually while creating the Dimension TextRange.
I am done with the Data Input. I am manually writing the code into Advanced Parameters Tab with Content as Other enabled for the variables(VWord, VFreq).
Along with the Word_Name i need to count the frequency means number of times the word Appears under Word_Count.
The next step is to make a new element in TextAnalysis Dimension with Alias name so that i can generate a new element with the Parameter passed in Parameter Tab.
With each W_001 until W_023 i need to do the Analysis of the word generated. I am bit confused in this scenario.
I have an idea like i can use ATTRS, ATTRPUTS and the concept of Index. Need your expert advice to guide me on this.
Code: Select all
Prolog Section Code:
#****Begin: Generated Statements***
#****End: Generated Statements****
#
#Set parameters and intialize variables
#
MetCnt=0;
DatCnt=0;
nType='N';
sType='S';
tCube='Analysis_Cube';
ParamCube='xParam';
TxtDim='TextRange';
AnaDim='TextAnalysis';
ValDim='TextFrequency';
tElem='Word_Name';
vElem='Word_Count';
aElem='A_001';
bElem='A_002';
#DimensionAttrInsert('','Aliass','A');
tAnaly='pAnalysis';
#tAnaly=DimensionElementPrincipalName(AnaDim, pAnalysis);
# Create new element****
IF( LONG(tAnaly) =0);
newElem= DIMSIZ(AnaDim)+1;
sindex='newElem';
sLen=LONG(sindex);
sTxtElem='A_' | FILL('0',3-sLen) | sindex;
#dimzize +1
DimensionElementInsert(AnaDim,'','sTxtElem',nType);
ENDIF;
# assign new element to variable aElem*****
index = aElem;
indCount = DIMSIZ(AnaDim);
#WHILE( index < indCount);
#index = index + 1;
#END;
#IF( LONG(tAnaly) =0);
#sTxtElem = DIMSIZ('AnaDim'+1);
#DimensionElementInsert(AnaDim,'','sTxtElem',nType);
#ENDIF;
# set parameter pAnalysis as alias attribute of new element*****
#DimensionElementPrincipalName - returns the principal name of an element or element alias
#IF( DimIX(AnaDim, aElem) = 0);
#DimensionElementInsert(AnaDim,'',sTxtElem,nType);
#ELSE;
#itemskip;
#ENDIF;
AttrInsert( AnaDim,'Analyss', 'Alias', 'A');
AttrPutS(tAnaly,AnaDim,aElem,'Alias');