Table of Contents

Search

  1. Preface
  2. Transformations
  3. Source transformation
  4. Target transformation
  5. Aggregator transformation
  6. Cleanse transformation
  7. Data Masking transformation
  8. Data Services transformation
  9. Deduplicate transformation
  10. Expression transformation
  11. Filter transformation
  12. Hierarchy Builder transformation
  13. Hierarchy Parser transformation
  14. Hierarchy Processor transformation
  15. Input transformation
  16. Java transformation
  17. Java transformation API reference
  18. Joiner transformation
  19. Labeler transformation
  20. Lookup transformation
  21. Machine Learning transformation
  22. Mapplet transformation
  23. Normalizer transformation
  24. Output transformation
  25. Parse transformation
  26. Python transformation
  27. Rank transformation
  28. Router transformation
  29. Rule Specification transformation
  30. Sequence Generator transformation
  31. Sorter transformation
  32. SQL transformation
  33. Structure Parser transformation
  34. Transaction Control transformation
  35. Union transformation
  36. Velocity transformation
  37. Verifier transformation
  38. Web Services transformation

Transformations

Transformations

Step 3. Create an array of structs

Step 3. Create an array of structs

Continue to configure the output by adding the purchase order details in the items array of structs. Configure the data processing strategies to sort by item number, group by part number, and aggregate the incoming quantity and price.
Perform the following steps
  1. Add a new output field with the following properties:
    Property
    Value
    Child Of
    PurchaseOrder
    Name
    Items_arr
    Type
    array
    Array Element Type
    struct
    Element Struct Name
    item_str
  2. Add all the incoming fields from PODetail to the Items_arr array in the output group.
  3. Delete the following field that you do not need in the output group: PurchaseOrder.Items_arr.OrderNumber.
  4. Add a filter condition for the PurchaseOrder.Items_arr array:
    :fld.{PODetail.OrderNumber}=:fld.{PurchaseOrder.OrderNumber}
    .
  5. Configure a group by field for the PurchaseOrder.Items_arr array: PODetail.PartNum.
  6. Configure an order by field in ascending order for the PurchaseOrder.Items_arr array: PODetail.ItemNum.
  7. Update the field expression for PODetail.Quantity in the PurchaseOrder.Items_arr array:
    SUM(:fld.{PODetail.Quantity})
    to aggregate quantity.
  8. Update the field expression for PODetail.Price in the PurchaseOrder.Items_arr array:
    SUM(:fld.{PODetail.Price})
    to aggregate price.
The following image shows the data configuration icons and expressions for the Items_arr array in the output group.
The Items_arr output group on the right displays active icons for data sources, filter, group by, and order by. The Quantity and Price fields show the aggregate expressions.

0 COMMENTS

We’d like to hear from you!