aggCount: Counts the total number of items in a dataset.
aggCountD: Counts the number of distinct items in a dataset.
aggStr: Concatenates all strings in a dataset, using a specified separator.
aggStrD: Concatenates distinct strings in a dataset, using a specified separator.
cumSum: Calculates cumulative sums (running totals) as the dataset progresses through a series.
cumCount: Assigns a sequential integer to each row in a list.
cumCountD: Assigns a sequential integer to each distinct item in a list.
Aggregators have a limitation when accessing a value within a sub-object, such as {d[].sub.qty}.
To handle this issue, use :print formatter to aggregate values coming from sub-objects. For example: {d[]:print(.sub.qty):aggSum}
Here is an example using :aggSum, which calculates and returns the total sum of all values in a dataset.
Carbone automatically iterates through the array and calculates the sum of all its elements if the [] brackets are left empty.
Array filters can be used to reduce the dataset by applying specific conditions.
You can calculate and display the cumulative sum of values using :cumSum instead of :aggSum. This allows you to track the running total as you iterate through the data.
Carbone aggregators support one or more parameters that allow you to divide data into separate groups (or "partitions") for independent calculations.
This functionality is similar to the PARTITION BY clause in SQL.
By specifying grouping parameters, you can ensure that the aggregation is performed independently for each defined group, making it easier to generate structured reports with grouped totals, averages, or other metrics.
The :aggCount aggregator returns the number of items of a dataset.
For more details on using aggregators and partitioning, refer to the examples provided for :aggSum.
It counts items regardless of the value passed on the left side of the formatter (e.g., {d[i].qty} in the example). The value is ignored by the formatter.
The :cumSum formatter, also called a running total, calculates the cumulative sum of data by continuously adding values as it moves through the series.
The :cumCount formatter returns a sequential integer to each row in a list.
A dynamic variable, partition, can be passed to :cumCount(partition). This ensures the row numbering resets to 1 for each partition and increments sequentially within that partition.
For more details on using aggregators and partitioning, refer to the examples provided for :aggSum.
It counts items regardless of the value passed on the left side of the formatter (e.g., {d[i].qty} in the example). The value is ignored by the formatter.
The :aggSum and :cumSum formatters can be used together in specific cases, such as calculating the total number of cars per country while also displaying a running total.