cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping issue 2

Former Member
0 Kudos

Source

><body>

> <mes>

> <ta>A</ta>

> <detail>

> <val>0030</val>

> <val>0033</val>

> <val>0030</val>

> <val>0030</val>

> </detail>

> </mes>

> <mes>

> <ta>B</ta>

> <detail>

> <val>0040</val>

> <val>0043</val>

> <val>0044</val>

> </detail>

> </mes>

></body>

target should be - repeat MAIN per unique val and GR = ta(source) (and of course, each main node must contain "its" TA value

><whole>

> <main>

> <gr>A</gr>

> </main>

> <main>

> <gr>A</gr>

> </main>

> <main>

> <gr>A</gr>

> </main>

> <main>

> <gr>B</gr>

> </main>

> <main>

> <gr>B</gr>

> </main>

></whole>

Nay idea, how to do this one?

Thnaks,

Olian

Edited by: Olian Saludew on Sep 1, 2008 2:04 PM

Accepted Solutions (1)

Accepted Solutions (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Olian,

For the target main:

<val> --> <removeContext> --> <sort> --> <splitByValue: ValueChanged> --> <collapseContext> --> <main>

For the target gr:

I'm assuming that the context for ta is: A, contextChange, B

I'm assuming that the context for val is: 0030, 0033, 0030, 0030, contextChange, 0040, 0043, 0044

1. <val> CONCAT with [ <ta> UseOneAsMany <val> <val> ] , the output should be 0030A, 0033A, 0030A, 0030A, 0040B, 0043B and 0044B

2. output of step 1 --> <removeContext> --> <sort: lexicographical> --> <splitByValue: Value Changed> --> <collapseContext> --> <subString: 4, 1>...so the output should only be letters A or B (assuming my substring numbers are correct) with the duplicates removed

As for the value, the same step like main is followed.. hope this helps

Edited by: dspboys on Sep 2, 2008 7:26 AM

Answers (1)

Answers (1)

hemant_chahal
Contributor
0 Kudos

You can do it with User Defined function take one parameter and cache entire queue option ticked in the mapping editor and calculate the length for array having unique strings.

then simply using for loop you can assign the value to target.