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

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.

0 COMMENTS

We’d like to hear from you!