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. Deduplicate transformation
  9. Expression transformation
  10. Filter transformation
  11. Hierarchy Builder transformation
  12. Hierarchy Parser transformation
  13. Hierarchy Processor transformation
  14. Input transformation
  15. Java transformation
  16. Java transformation API reference
  17. Joiner transformation
  18. Labeler transformation
  19. Lookup transformation
  20. Mapplet transformation
  21. Normalizer transformation
  22. Output transformation
  23. Parse transformation
  24. Python transformation
  25. Rank transformation
  26. Router transformation
  27. Rule Specification transformation
  28. Sequence Generator transformation
  29. Sorter transformation
  30. SQL transformation
  31. Structure Parser transformation
  32. Transaction Control transformation
  33. Union transformation
  34. Velocity transformation
  35. Verifier transformation
  36. Web Services transformation

Transformations

Transformations

Vertical macro example

Vertical macro example

To find the annual sum of quarterly data for each store, you might use a vertical expression macro in an Aggregator transformation.
The Aggregator transformation uses the store ID field as the group by field. A %QuarterlyData% macro input field reads sales data from the following input fields: Q1, Q2, Q3, and Q4.
A %QuarterlyData%_out macro output field is based on the %QuarterlyData% macro input field. To find the sum of sales for each quarter, the macro output field includes the following expression:
SUM(%QuarterlyData%)
.
In the Target transformation, a field rule includes the following output fields in the incoming fields list: Q1_out, Q2_out, Q3_out, Q4_out. In the target field mapping, the Qx_out fields are mapped to the target.
The following image shows the vertical expression macro in an Aggregator transformation:
The image shows a mapping with a Source to Aggregator to Target. The Properties panel displays the Aggregate tab of the Aggregator transformation with a %QuarterlyData% macro input field that defines the input fields. It also shows the %QuarterlyData%_out macro output field with the following expression: SUM(%QuarterlyData%).
When the task runs, the expression expands vertically, as follows:
SUM(Q1) SUM(Q2) SUM(Q3) SUM(Q4)
The task groups the data by store when it performs the aggregation and writes the results to the target.