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

Re: PI Mapping

$
0
0

Hi,

 

I assume that you want E1EDP01 to be repeated as many times as the no. of records come except the cases where code value is not blank. It can be done simply by: if length of field 'Code' = 0; then CreateIf->E1EDP01. But I have one doubt, is it such that for each customer say 100,200 the code may occur multiple times. In such a case the above logic may work fine. In case if it is such that the source will have one code per Customer & the no. of E1EDP01 will be one less than total no.of Customer minus the one where Code exists:

 

Customer    Code

100        10

200        20

300        30

100

100

200

300

300

 

Thus you want to have two E1EDP01 for 100, one for E1EDP01,two for E1EDP01. In this case you can also have the logic sort the customer, then split by value(value change), count,then substract 1 as you will have one code for each customer. Using this count say inp1, you can have a small UDF for creating no. of contexts as per the count in var1. The input for inp2 will be code field:

for(int a=0;a<inp1.length;a++){

 

    int temp = Integer.parseInt(inp1[a]);

 

    for(int b=0;b<temp;b++){

 

        result.addValue(inp2[a]);

 

    }

 

}


Viewing all articles
Browse latest Browse all 10548

Trending Articles



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