Forum Discussion

sean_cochran's avatar
sean_cochran
Icon for Resolver I rankResolver I
2 years ago
Solved

Conditional Distinct Count of Values

In a working Deneb visual that displays survey data, I have a relatively flat dataset structured this way:   When aggregating this data, I want a count of distinct values for "person" - ONLY ...
  • sean_cochran's avatar
    2 years ago

    I found a simple solution. I used a "missing" op in my aggregation step to detect when null values were present in the data, and then subtracted 1 from the value of a "distinct" aggregation in a later calculate step whenever a null value was present in the series. Sample chart and dataset available at this link in the Vega editor.

    Chart below: