This page explains how to use the set_difference function in APL.
set_difference
function in APL to compute the distinct elements in one array that are not present in another. This function helps you filter out shared values between two arrays, producing a new array that includes only the unique values from the first input array.
Use set_difference
when you need to identify new or missing elements, such as:
Splunk SPL users
setdiff
function from the mv
(multivalue) function family. APL’s set_difference
behaves similarly, returning values that are only in the first multivalue field.ANSI SQL users
EXCEPT
when working with rows, not arrays. APL provides native array functions like set_difference
for this purpose.Name | Type | Description |
---|---|---|
Array1 | array | The array to subtract from. |
Array2 | array | The array containing values to remove from Array1 . |
Array1
that are not present in Array2
. The result does not include duplicates.
set_difference
to return the difference between two arrays.
Query
_time | difference |
---|---|
May 22, 11:42:52 | [5, 1, 4] |