| A simple example to show how aggregation works in the IBL. | | Aggregation over a table includes duplicate rows, but aggregation over a rule result excludes them. | | For clarity, it's best to use a key, such as a row numbering, when aggregating. the table has a row some-r some-x some-y -------------------------------------------------- there is a value that-x in column one of the table the table has a row some-r some-x some-y ---------------------------------------- the rule has a row that-r that-x that-y the table has a row some-r some-x some-y ---------------------------------------- the drop r rule has a row that-x that-y the table has a row some-r some-x some-y ---------------------------------------- the drop x rule has a row that-r that-y the table has a row this-r this-x this-y ======================================== 1 aa 4 2 aa 5 3 bb 3 4 bb 3 5 cc 6 sum some-y : the table has a row some-r some-x some-y = some-z ------------------------------------------------------- the column three total is that-z sum some-y : the rule has a row some-r some-x some-y = some-z ------------------------------------------------------- the column three rule total is that-z sum some-y : the drop r rule has a row some-x some-y = some-z ------------------------------------------------------- the column three drop r rule total is that-z sum some-y : the drop x rule has a row some-r some-y = some-z ------------------------------------------------------- the column three drop x rule total is that-z avg some-y : the table has a row some-r some-x some-y = some-z ------------------------------------------------------- the column three avg is that-z max some-y : the table has a row some-r some-x some-y = some-z ------------------------------------------------------- the column three max is that-z min some-y : the table has a row some-r some-x some-y = some-z ------------------------------------------------------- the column three min is that-z count some-y : the table has a row some-r some-x some-y = some-z --------------------------------------------------------- the number of entries in column 3 of the table is that-z count : the table has a row some-r some-x some-y = some-z -------------------------------------------------- the number of rows in the table is that-z there is a value some-x in column one of the table count some-y : the table has a row some-r that-x some-y = some-z ------------------------------------------------------------------------------- for col two value that-x the number of entries in column 3 of the table is that-z there is a value some-x in column one of the table count : the table has a row some-r that-x some-y = some-z ------------------------------------------------------------------ for col two value that-x the number of rows in the table is that-z there is a value some-x in column one of the table sum some-y : the table has a row some-r that-x some-y = some-z --------------------------------------------------------------- the total for that-x is that-z | This file is an application written in the language Executable English. | You can view, run and change it by pointing a browser | to www.reengineeringllc.com and selecting Aggregation.