This page explains how to use the make_set_if aggregation function in APL.
make_set_if
aggregation function in APL allows you to create a set of distinct values from a column based on a condition. You can use this function to aggregate values that meet specific criteria, helping you filter and reduce data to unique entries while applying a conditional filter. This is especially useful when analyzing large datasets to extract relevant, distinct information without duplicates.
You can use make_set_if
in scenarios where you need to aggregate conditional data points, such as log analysis, tracing information, or security logs, to summarize distinct occurrences based on particular conditions.
Splunk SPL users
values
with a where
condition to achieve similar functionality to make_set_if
. However, in APL, the make_set_if
function is explicitly designed to create a distinct set of values based on a conditional filter within the aggregation step itself.ANSI SQL users
GROUP BY
in combination with conditional aggregation, such as using CASE WHEN
inside aggregate functions. In APL, the make_set_if
function directly aggregates distinct values conditionally without requiring a CASE WHEN
.column
: The column from which distinct values will be aggregated.predicate
: A condition that filters the values to be aggregated.[max_size]
: (Optional) Specifies the maximum number of elements in the resulting set. If omitted, the default is 1048576.make_set_if
function returns a dynamic array of distinct values from the specified column that satisfy the given condition.
method | make_set_if_geo.city |
---|---|
GET | [‘New York’, ‘San Francisco’] |
POST | [‘Berlin’, ‘Tokyo’] |
make_set_if
, but returns a list that can include duplicates instead of a distinct set.