String While Loop
Posted: Thu Mar 26, 2015 7:41 pm
I have to add string data to a cube.
The code has to do the following - scan through cube, if the combination of location and classification exist on a line item .
Then itemskip else, add the string values to the next open line item.
The sequence number below is based on the following logic. Each planning entity has 200 line items.
eg will be 'Aviation_1'
I played around with the below code and got 2 answers. Either data gets stored at the seqnumber 200 or at all of the seqnumber.
Any advice.
The code has to do the following - scan through cube, if the combination of location and classification exist on a line item .
Then itemskip else, add the string values to the next open line item.
The sequence number below is based on the following logic. Each planning entity has 200 line items.
eg will be 'Aviation_1'
I played around with the below code and got 2 answers. Either data gets stored at the seqnumber 200 or at all of the seqnumber.
Code: Select all
nCount = 1;
nMax = 200;
WHILE( nCount <= nMax );
sSNR = Subst(sSeqNumber,1,Scan('_',sSeqNumber))|NumbertoString(ncount);
IF(CellGetS(sTargetCube,
CellGetS(sParamCube,'CurrentReportingPeriod','Value'),sExpType,
sReportingVersion,
sSNR ,'Locations') @= sLocation
&
CellGetS(sTargetCube,
CellGetS(sParamCube,'CurrentReportingPeriod','Value'),sExpType,
sReportingVersion,
sSNR ,'Classification') @= sClassification));
ITEMSKIP;
ELSE;
IF(CellGetS(sTargetCube,
CellGetS(sParamCube,'CurrentReportingPeriod','Value'),sExpType,
sReportingVersion,
sSNR ,'Locations') @= '');
CellPutS(sLocation,sTargetCube,
CellGetS(sParamCube,'CurrentReportingPeriod','Value'),sExpType,
sReportingversion,
sSNR ,'Locations');
ENDIF;
nCount = nCount + 1;
END;