on 11-14-2013 7:17 AM
Source
-ProdOrder.................1-n
---CapacityRecord..........1-n
-----OperationNo...........0-1
-----SequenceNo............0-1
-----ControlKey............0-1
:
:
etc
Target
-Prod_Order...............1-n
---Dept_Data..............14-14
-----StandardTime.........1.1
-----RTINS................1.1
-----RTINST...............1.1
:
:
etc
For each ProdOrder everytime the target is created Dept_Data needs to occure 14 times with data from each CapacityRecord.
For example, if 1 ProdOrder contains 6 Capacity records in it, then the first 6 Dept_Data needs to be populated based upon the data of those 6 CapacityRecord and the next 8 Dept_Data will have blank values in it.
Please let me know how to achieve this.
Hello,
Try this:
1) Duplicate Dept_Data
2) Map Capacity_Record with Target Dept_Data node and map rest of the elements as per ur business logic
3) For the duplicated node use below UDF
int count = Integer.parseInt(var1[0]);
if(count<14)
{
for(int i =0;i<14-count;i++)
{
result.addValue("");
}
}
else
result.addSuppress();
Mapping:
a) Capacity_Record --Count --UDF---Dept_Data
b) Eventually, map constant to all the elements inside the duplicated Dept_Data
Thanks
Amit Srivastava
\
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Subhra
Please do the mapping as below
Create one udf for populating the root strcuture
map the root node as below
write one more udf for populating fields
code:
int cnt = Integer.parseInt(count[0]);
for ( int i = 0; i< cnt; i++)
{
result.addValue(fieldval[i]);
}
for ( int k = 0; k<14-cnt; k++)
{
result.addValue("");
}
map the field as
Output:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.