Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8511

BPC 10 MS Transformation Mapping formula to remove padded zeroes from external data

$
0
0


Hi,

 

Does anyone have any experience of successfully removing padded zeroes from data through a mapping statement?

 

I have an extract from our SAP ERP system that pads everything with preceding zeroes and most I can deal with through conversion files for each dimension.

 

However, for one dimension I do not want to do this since the conversion file needs to be maintained by users using the internal member ids of another dimension.  These internal member id's are the unpadded version of the data.  And I do not want them to have to maintain more than one conversion file since we load data from more than one source - not just SAP ERP.

 

As an example we have cost centres like 1019239, 23156, 306578.  This is how "users" of the SAP ERP system see them and how they want to see them in BPC.  The extract file pads them to 10 digits to be 0001019239, 0000023156, 0000306578.  Note that some records are null for this dimension.

 

Now, in a conversion file I could simply pad all the cost centres to 10 digits and convert them to the corresponding dimension members that I need (cost centre functions).

 

In the Transformation file *MAPPING it is more restrictive.  I could use the *Col(5,a:10) function if the length of the cost centre numbers was constant and I could define a in the formula (5 is the column reference since the file also has no usable header information).  However, as you can see in the examples above they are anything between 5 digits and 8 and sometimes null.

 

So, I tried the *if function to test the preceding digits: *if(*col(5,3:6)=*str(0000) then *col(5,4:10); *col(5,4:6)=*str(000) then *col(5,5:10); etc ending with *col(5,6:10) for the else statement.

 

But this does not work.  I get no rejections to look at, just an "Exception has been thrown by the target of an invocation" error.

 

I assume that this is because the tests for 000 and 00 are also true when the test for 0000 is true and the statement cannot be resolved.

 

It did work for one statement in the *if formula - the one that only looks at a 5 digit scenario. I of course get rejections for all cost centres with more digits and I assume that all the other scenarios would also work in isolation.

 

By the way the *col(5,6:10) formula fails for null values where I have used the NULLAMOUNTVALUE=99999 statement in the *OPTIONS.  It returns NULL.  This means I have to test for items =*Str() in my *if statement (along with the test for the preceding 0's) and use simply *Col(5) in these cases to return the 99999 value which can then be converted successfully.

 

Basically I am looking for a function that is the opposite of *PAD that takes away preceding contiguous characters that you sepcify in the function from the external data.

 

If you have any further insight or suggestions I would be grateful to hear them.

 

We are using SP12 and will upgrade to SP14 soon.

 

Thanks

 

Chris


Viewing all articles
Browse latest Browse all 8511