Description
TheArray and If combinators can be applied to the uniq
function to count the number of unique values in arrays for rows where the
condition is true, using the uniqArrayIf aggregate combinator function.
-
If and -Array can be combined. However, Array must come first, then If.arrayJoin.
Example usage
Count unique products viewed by segment type and engagement level
In this example, we’ll use a table with user shopping session data to count the number of unique products viewed by users of a specific user segment and with an engagement metric of time spent in the session.Query
Response