If you only want to process the numbers in the cube, then you have to build a subset of just the measures that hold numbers and then assign that subset to the view that is named as the cube view being used by the process. If you want a mixed subset of measures, both numeric and string, then the link discusses it in some detail and has code snippets.
Hi Robin and Gurus, This is what I have tried so far unsucessfully:
Firstly,I do have subset of numeric elements and assigned to source view:
Code: Select all
Prolog:
#Defining Source Cube,View and Dimension#
SCub='DU_SERVICES_REPORT';
SDim='sa_period';
SVw='Source View';
#Making sure Source View exists for the Process##
IF(VIEWEXISTS(SCub,SVw)=0);
VIEWCREATE(SCub,SVw);
ENDIF;
##Creating ubset for source view##
IF
(SUBSETEXISTS(SDim,'Ssub')=1);
SUBSETDELETEALLELEMENTS(SDim,'Ssub');
ELSE;
SUBSETCREATE(SDim,'Ssub');
ENDIF;
##Inserting measure elements in to the source view#
SUBSETELEMENTINSERT(SDim,'Ssub','Charged Current Year',1);
SUBSETELEMENTINSERT(SDim,'Ssub','Charged Previous Year',2);
#Defining the view setup#
#Since Source cube consists rule derived values I want to include it#
# VIEWROWSUPPRESSZEROESSET(SCub,'SVw',0);
VIEWEXTRACTSKIPCALCSSET(SCub,SVw,1);
VIEWEXTRACTSKIPRULEVALUESSET(SCub,SVw,0);
#-------Assign Data Source---#
DataSourceType='View';
DataNameForServer='DU_SERVICES_REPORT';
DataSourceNameForClient='DU_SERVICES_REPORT';
DataSourceCubeView=SVw;
1. Below code runs fine and shows process ran successfully but no data gets copied and works only when I make "Value variable" numeric to string.
Code: Select all
Data tab
NVal= CellGetN('DU_SERVICES_REPORT',SCENERIO,SERVICES, RATE_TA, BUSINESSUNIT, PRODUCTSEQUENCE, PART,'Charged Current Year');
NVal1= CellGetN('DU_SERVICES_REPORT',SCENERIO,SERVICES, RATE_TA, BUSINESSUNIT, PRODUCTSEQUENCE, PART,'Charged previous Year');
CellPutN(NVal,'SSM_EXPENSES_REPORTING',SCENERIO,SPECIALITY,PA_EXPENSE,'BUSINESS UNITS',SEQ_DET,PART,'Charge Rate Year 0',sDim1CurEl,sDim2CurEl);
CellPutN(NVal1,'SSM_EXPENSES_REPORTING',SCENERIO,SPECIALITY,PA_EXPENSE,'BUSINESS UNITS',SEQ_DET,PART,'Charge Rate Year 0',sDim1CurEl,sDim2CurEl);
But as soon as I change "Value variable "to numeric data type,It gives
",Data Source line (1) Error: MetaData procedure line (0): Cannot convert field number 8, value "002587 - Turn _Dep" to a real number"
2. I have also tried (Value_is_String=1) as below
This returns me same type of error as number one.I have tried with Value variable as Numeric first ,later as as String but no success.
Code: Select all
IF( VALUE_IS_STRING = 1 );
CellPutS(SVALUE,'SSM_EXPENSES_REPORTING',SCENERIO,SPECIALITY,PA_EXPENSE,'BUSINESS UNITS',SEQ_DET,PART,'Charge Rate Year 0',sDim1CurEl,sDim2CurEl);
ELSE;
CellPutN(NVALUE, 'SSM_EXPENSES_REPORTING',SCENERIO,SPECIALITY,PA_EXPENSE,'BUSINESS UNITS',SEQ_DET,PART,'Charge Rate Year 0',sDim1CurEl,sDim2CurEl);
ENDIF;
3. I have also tried:
Before this I did changed Value variable to String
Code: Select all
vElType = DTYPE( sa_period, 'Charge Rate Year0' );
IF( vElType @= 'N' );
CellPutN( NUMBR(Value), 'SSM_EXPENSES_REPORTING',SCENERIO,SPECIALITY,PA_EXPENSE,'BUSINESS UNITS',SEQ_DET,PART,'Charge Rate Year 0',sDim1CurEl,sDim2CurEl );
ELSE;
CellPutS(Value, 'SSM_EXPENSES_REPORTING',SCENERIO,SPECIALITY,PA_EXPENSE,'BUSINESS UNITS',SEQ_DET,PART,'Charge Rate Year 0',sDim1CurEl,sDim2CurEl);
ENDIF;
similarly I did the same with 'Charge Rate Year 1'
When I put NUMBR Function before NVal, the process giving me invalid string expression error.After process being run the following error
" Data Source Line (1) Error Data procedure line 33, Cell Type is real"
I might be doing something terribly wrong Is it something to do with two string elements in me period_sa dimension,Would it help if I create subset for these and assign to source view , Appreciate our help.Thanks