|
Home > Archive > BizTalk Server General > February 2005 > Mapping many records to one flat record
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Mapping many records to one flat record
|
|
|
| Hi, I use Looping and Value Mapping (Flattening) functoid
for mapping from two records (with loop on each record) to
one flat record, but using these functoids does't help.
I use BTS 2002 tools and BTS SP1 is installed. Do you think
you can help med to find out the problem? Below I explain
the problem in detail. Also I can send you a sample map with
test file.
The structure of the input file is:
Group (0/*)
-- Record1 (1/*)
-- Field1
-- Field2
-- Record2 (1/*)
-- Field1
-- Field2
An example file of this structure could be like this:
H01EValE
H01BValB
H01AValA
H02DValD
H02FValF
H02CValC
H01EValE
H01BValB
H01AValA
H02DValD
H02FValF
H02CValC
.... where ...
position 1-3 = record identifier
position 4 = qualifier
position 5-8 = value
The structure of the output file is:
Record (1/*)
-- Field1
-- Field2
-- Field3
-- Field4
-- Field5
-- Field6
And these fields are mapped from input file, from different
records/fields based on qualifier. The result I expect should
look like :
R01:ValA:ValB:ValC:ValD:ValE:ValF
R01:ValA:ValB:ValC:ValD:ValE:ValF
But the result will be like …
R01::::ValD:ValE
… that means only the first occurrence of H01 and H02 will be populated/mapped
Thanks in advance!
/Peter
| |
|
| Peter,
Make a loop between "Group" on source side and "Record" on destination side
using Looping functoid. But then instead of Value Mapping (Flattening) use
normal Value Mapping and link it to a Cumulative String functoid. Enter "1"
as second
input parameter to Cumulative String. In this case Looping functoid makes
loops in a higher level and Cumulative String makes mini-loops on each record
(H01 and H02) on the source side.
/Shaba
"Peter" wrote:
> Hi, I use Looping and Value Mapping (Flattening) functoid
> for mapping from two records (with loop on each record) to
> one flat record, but using these functoids does't help.
>
> I use BTS 2002 tools and BTS SP1 is installed. Do you think
> you can help med to find out the problem? Below I explain
> the problem in detail. Also I can send you a sample map with
> test file.
>
> The structure of the input file is:
>
> Group (0/*)
> -- Record1 (1/*)
> -- Field1
> -- Field2
> -- Record2 (1/*)
> -- Field1
> -- Field2
>
> An example file of this structure could be like this:
>
> H01EValE
> H01BValB
> H01AValA
> H02DValD
> H02FValF
> H02CValC
> H01EValE
> H01BValB
> H01AValA
> H02DValD
> H02FValF
> H02CValC
>
> ... where ...
>
> position 1-3 = record identifier
> position 4 = qualifier
> position 5-8 = value
>
>
> The structure of the output file is:
>
> Record (1/*)
> -- Field1
> -- Field2
> -- Field3
> -- Field4
> -- Field5
> -- Field6
>
> And these fields are mapped from input file, from different
> records/fields based on qualifier. The result I expect should
> look like :
>
> R01:ValA:ValB:ValC:ValD:ValE:ValF
> R01:ValA:ValB:ValC:ValD:ValE:ValF
>
> But the result will be like …
>
> R01::::ValD:ValE
>
> … that means only the first occurrence of H01 and H02 will be populated/mapped
>
> Thanks in advance!
>
> /Peter
>
| |
|
| Hi Shaba, it works now. Thanks a lot!
- Peter
"Shaba" wrote:
[vbcol=seagreen]
> Peter,
>
> Make a loop between "Group" on source side and "Record" on destination side
> using Looping functoid. But then instead of Value Mapping (Flattening) use
> normal Value Mapping and link it to a Cumulative String functoid. Enter "1"
> as second
> input parameter to Cumulative String. In this case Looping functoid makes
> loops in a higher level and Cumulative String makes mini-loops on each record
> (H01 and H02) on the source side.
>
> /Shaba
>
>
> "Peter" wrote:
>
|
|
|
|
|