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

How to calculate length of the string in transformation file

$
0
0

Hello all

 

I have tried a number of ways and I am not able to calculate the length of the incoming field in transformation file for my data load. Here is the issue.

 

I have an incoming string of length 10 and I need to use it to update multiple dimensions which will need first 2, 4 ,6 , 8 characters respectively.

 

Now in transformation file ID=ID(1:2) works perfect. However, the BW InfoObject will have multiple values as shown below:

IDDescription
ABBusiness
ABCDBusiness Organization
ABCDEFBusiness Line
ABCDEFGHProduct Family
ABCDEFGHIJProduct Line
ABCDEFGHIJKLBrand

 

I want to update my dimension for Business Organization. I need to update only the records where the length of the incoming string is 4. If I do ID(1:4), I will get the duplicate records and will see the ID less than 4 characters in rejected records. The latter is not such a big issue but the former one is as I need to fetch the right description as well. The formula should check the length and then only pass the record else a dummy value.

 

A formula to achieve this in the transformation file is what I am looking for.

 

Regards

Gajendra


Viewing all articles
Browse latest Browse all 8557

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>