Skip to content
IRI Logo
Solutions Products
  • Solutions
  • Products
  • Blog
  • BI
  • Big Data
  • DQ
  • ETL
  • IRI
    • IRI Business
    • IRI Workbench
  • Mask
  • MDM
    • Master Data Management
    • Metadata Management
  • Migrate
    • Data Migration
    • Sort Migration
  • Test Data
  • Transform
  • VLDB
  • VLOG

Multiply Aggregation

  • by Paul Friedland

As CoSort users have known for a long time, the Sort Control Language (SortCL) program supports multi-level, conditional aggregation functions on a static or running basis. These functions have included value ranking, and:

  • /SUM
  • /MIN
  • /MAX
  • /AVERAGE
  • /COUNT

aggregations, but not multiplication. However, multiplication in SortCL is possible.

Consider this source data for example:

1.00
2.00
3.00
4.00
5.00

The SortCL job script below uses exponentiation on the sum of logs to get the product of down-values, based on the idea provided at http://viralpatel.net/blogs/row-data-multiplication-in-oracle/.

/INFILE=Source
  /field = (x,pos = 1,size = 5.2, numeric)
/REPORT  # no sort
/OUTFILE=Target
  /HEADREC = "    x       log(x)    Sigma   exp(Sigma)\n"
  /FIELD = (x,                type = numeric, pos =  1, size =7.2)
  /FIELD = (log_x = log(x),   type = numeric, pos = 12, size =7.5)
  /FIELD = (Sigma_log_x ,     type = numeric, pos = 22, size =7.5)
  /FIELD = (exp(Sigma_log_x), type = numeric, pos = 32, size =7.2)
  /SUM Sigma_log_x from log_x running

The output contains the multiple (product) in the last column.

x       log(x)    Sigma   exp(Sigma)
1.00    0.00000   0.00000      1.00
2.00    0.69315   0.69315      2.00
3.00    1.09861   1.79176      6.00
4.00    1.38629   3.17805     24.00
5.00    1.60944   4.78749    120.00
New Features in CoSort 9.5.3
MDM Thoughts
big data transformation CoSort cosort sample script sort join aggregation SortCL

Related articles

Prepare and Protect Data for…
Running IRI Software in a…
The IRI Platform
IRI Test Data Generation
IRI Data Quality and Improvement
IRI Voracity and Test Design…
Creating Set Files in IRI…
All About IRI Set Files:…
Real-time Database Data Replication
Getting Started with IRI Ripcurrent
Mapping DB Data Types

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Big Data 66
  • Business Intelligence (BI) 77
  • Data Masking/Protection 163
  • Data Quality (DQ) 41
  • Data Transformation 94
  • ETL 122
  • IRI 229
    • IRI Business 86
    • IRI Workbench 162
  • MDM 37
    • Master Data Management 12
    • Metadata Management 25
  • Migration 65
    • Data Migration 60
    • Sort Migration 6
  • Test Data 102
  • VLDB 78
  • VLOG 40

Tracking

© 2025 Innovative Routines International (IRI), Inc., All Rights Reserved | Contact