Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [SOLVED]Transform looping
Go
New
Search
Notify
Tools
Reply
  
[SOLVED]Transform looping
 Login/Join
 
Member
posted
Hi,

I need to create a transform that has an input like this:
<Order>
  <OrderHeader>
    <Customer>1234</Customer>
  </OrderHeader>

  <OrderDetail>
    <Line>10</Line>
    <Product>4321</Product>
  <OrderDetail>

  <OrderDetail>
    <Line>20</Line>
    <Product>9876</Product>
  <OrderDetail>

  <OrderWeight>
    <Line>10</Line>
    <Weight>324.45</Weight>
    <WeightUOM>KG</WeightUOM>
  </OrderWeight>

  <OrderWeight>
    <Line>20</Line>
    <Weight>134.45</Weight>
    <WeightUOM>KG</WeightUOM>
  </OrderWeight>
  
</Order>


The problem is that I need in my output to merge the OrderDetail and OrderWeight to get something like this:
<Order>
  <OrderHeader>
    <Customer>1234</Customer>
  </OrderHeader>

  <OrderDetail>
    <Line>10</Line>
    <Product>4321</Product>
     <Weight>324.45</Weight>
    <WeightUOM>KG</WeightUOM>
  <OrderDetail>

  <OrderDetail>
    <Line>20</Line>
    <Product>9876</Product>
    <Weight>134.45</Weight>
    <WeightUOM>KG</WeightUOM>
  <OrderDetail>
 
</Order>


By creating Groups with filters, I managed to get the good values, but the problem is that only the last OrderDetail has the value assigned. I get something like this:
  <OrderDetail>
    <Line>10</Line>
    <Product>4321</Product>
    <Weight/>
    <WeightUOM/>
  <OrderDetail>

  <OrderDetail>
    <Line>20</Line>
    <Product>9876</Product>
    <Weight>134.45</Weight>
    <WeightUOM>KG</WeightUOM>
  <OrderDetail>


Does anybody has an idea what could be wrong? Is it possible to loop through element that are outside the current loop?

This message has been edited. Last edited by: Charles Maheu,


WebFocus 7.6.8
OS: Windows
iWay: 6.1.4
 
Posts: 15 | Registered: September 14, 2010Reply With QuoteReport This Post
Expert
posted Hide Post
I'd use nested loops in WebFOCUS DM... Where are you doing THIS?
 
Posts: 2976 | Location: Middle Tennessee [8204M Gen48 in Test&Prod] | Registered: February 23, 2005Reply With QuoteReport This Post
Member
posted Hide Post
iWay Transformer.

Nested loop gives me the result described in my original post.

Regards,
Charles


WebFocus 7.6.8
OS: Windows
iWay: 6.1.4
 
Posts: 15 | Registered: September 14, 2010Reply With QuoteReport This Post
Member
posted Hide Post
Which version of iway transformer are you using - Just ran your input on ism 6.1.7 and got you required output. Let me know if you need the GXP.


iSM 6.1.6
iDM 7.7.4
Windows 2008 R2
 
Posts: 2 | Registered: December 21, 2012Reply With QuoteReport This Post
Member
posted Hide Post
I'm using 6.1.4 and yes i'd like to see that gxp if possible.

Regards,
Charles


WebFocus 7.6.8
OS: Windows
iWay: 6.1.4
 
Posts: 15 | Registered: September 14, 2010Reply With QuoteReport This Post
Member
posted Hide Post
Ok I got it working.

I'm not sure if it's the better way, but it worked.

What I did is that concatenate my line number with the value using seperator before the main loop.

Then in the loop using the line number I can get the substring of my value.

Like I said it's not clean, but it worked.

Thanks for your help.

Paul_Maitland: If you could still provide me your GXP, i'd like to see your solution.

Regards,
Charles


WebFocus 7.6.8
OS: Windows
iWay: 6.1.4
 
Posts: 15 | Registered: September 14, 2010Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [SOLVED]Transform looping

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.