Skip to Content
avatar image
Former Member

Mapping issue 2

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    Sep 01, 2008 at 03:59 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 01, 2008 at 02:45 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded