Back to forum list… Back to How Do I?...

Pivot using Flatten & Hierarchy (2 replies)

Sue Herrmannn
11 years ago
Sue Herrmannn 11 years ago

I need another jump start on something. I’ve been banging my head against the wall this morning.

  • Using the database reader, I pulled order header and detail information out of Sage 300. (this works)

SELECT OEORDH.ORDNUMBER, OEORDH.CUSTOMER, OEORDH.SHPNAME, OEORDH.SHPADDR1, OEORDH.SHPADDR2,OEORDH.SHPCITY, OEORDH.SHPSTATE, OEORDH.SHPZIP, OEORDH.SHPCOUNTRY, OEORDH.SHPPHONE, OEORDH.SHPCONTACT,OEORDH.PONUMBER, OEORDH.TYPE, OEORDH.EXPDATE, OEORDH.SHIPVIA, OEORDH.LASTINVNUM, OEORDD.ITEM, OEORDD.QTYBACKORD, OEORDD.QTYSHPTODT
FROM OEORDH LEFT OUTER JOIN OEORDD ON OEORDH.ORDUNIQ = OEORDD.ORDUNIQ
WHERE OEORDH.TYPE = 1 AND OEORDD.COMPLETE = 0

  • Using the transform connector, I created a new field ORDERNO: if item # = UPS-RET then ORDERNO = Order # +”R” else ORDERNO = Order #. (this works)
  • The next thing I need to do is take all of these records and group them by ORDERNO – I need to pull subtotals of qtys, maximums, minimums and some basic info that stays the same throughout like ship via codes. ß this last piece is the part that is confusing me.
  • I played with the flatten connector but it seems like you have to start with a truly hierarchical query (separate records for header and details) in order to flatten
  • oI tried a group by in SQL and in Iman – but since I want to evaluate the information based on the new formula ORDERNO, this is a real pain. I played with it a bit and could continue to try this if this is my best option.

Can you give me a hint? J From there, I’m just exporting to excel and that doesn’t look hard at all… Thanks!

Support
11 years ago
Support 11 years ago

Sue, to achieve this will need 4 transforms:

  1. In a map transform, create your ORDERNO field (which you've already done).
  2. Use a hierarchy transform to create a header/detail structure where the first key is the ORDERNO field (from step 1).
  3. Use a Map transform, within the header record, create fields for each of the "Aggregate" functions (Minimum, Maximum, Sum).
  4. Use flatten to flatten out the dataset.

Hope this helps, but feel free to ask any more questions.

11 years ago
Support 11 years ago

Closed due to inactivity.

Contact

Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

Looking to purchase IMan, please see our resellers here.

Realisable Software
Ph: +44 (0) 208 123 1017

Copyright © Realisable. All rights reserved.
Realisable is a registered trademark

Close

Request Demo

Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

Looking to purchase IMan, please see our resellers here.

Realisable Software
Ph: +44 (0) 208 123 1017

Copyright © Realisable. All rights reserved.
Realisable is a registered trademark

Close

Access Downloads

Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

Looking to purchase IMan, please see our resellers here.

Realisable Software
Ph: +44 (0) 208 123 1017

Copyright © Realisable. All rights reserved.
Realisable is a registered trademark

Close