Table of Contents

Search

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