Is there a way to use Count Distinct in CE_AGGREGATION?
I tried
var_out = CE_AGGREGATION(:var, [COUNT(DISTINCT "A") as "COUNT"], ["B", "C"]);
to get the number of distinct values of "A" for each combination of "B" and "C", but activation fails.
My workaround currently is to use two aggregations:
var_dummy = CE_AGGREGATION(:var, [COUNT("A") as "DUMMY"], ["A", "B", "C"]);
var_out = CE_AGGREGATION(:var_dummy, [COUNT("A") as "COUNT"], ["B", "C"]);
It works well but I am not sure if this is the most efficient way to do it (performance).
For example, would it be better to get :var from an analytical view (already aggregated to columns "A", "B", "C" --> only one CE_AGGREGATION needed) instead of using CE_COLUMN_TABLE and two aggregations?
Thanks for your Feedback,
Fabian