# How does runningDistinctCount work? \*\*\*\*\*\*Quick Sight Guide Has No Instructions\*\*\*\*\*\*\*

**URL:** <https://community.amazonquick.com/t/how-does-runningdistinctcount-work-quick-sight-guide-has-no-instructions/1589>\
**Category:** Q&A\
**Tags:** calculations, quick-sight\
**Created:** [February 17, 2022, 2:11pm UTC](https://community.amazonquick.com/t/how-does-runningdistinctcount-work-quick-sight-guide-has-no-instructions/1589 "2022-02-17T14:11:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zach](https://avatars.discourse-cdn.com/v4/letter/z/51bf81/32.png) [@Zach](https://community.amazonquick.com/u/Zach)\
**Post date:** [February 17, 2022, 2:11pm UTC](https://community.amazonquick.com/t/how-does-runningdistinctcount-work-quick-sight-guide-has-no-instructions/1589/1 "2022-02-17T14:11:18Z")

</div>

I am trying to use the runningDistinctCount function but I can’t figure out the ‘aggregated uniotSet’.

Clicking Learn More when looking at the runningDistinctCount function in the calculated field builder directs to the Quick Sight User Guide. However, there are no search results for runningDistinctCount

---

<div class="post-metadata">

**Author:** ![darcoli](https://avatars.discourse-cdn.com/v4/letter/d/bb73d2/32.png) [@darcoli](https://community.amazonquick.com/u/darcoli)\
**Post date:** [February 19, 2022, 5:29pm UTC](https://community.amazonquick.com/t/how-does-runningdistinctcount-work-quick-sight-guide-has-no-instructions/1589/2 "2022-02-19T17:29:20Z")

</div>

I have also tried using that but to no avail. To be fair I never saw an announcement about `runningDistinctCount()` so assumed that it was made available publicly before being fully functional 🤫

However, until now I have always used a workaround to get the same functionality as `runningDistinctCount()` as follows:

```auto
runningSum(
  distinct_count(
    ifelse(
      datetime=minOver({date}, [{user_id}], PRE_AGG),
      {user_id},
      NULL
    )),
  [{date} ASC],
  []
)

```

This would give you the runningDistinctCount of `user_id`'s over the `date` field. It achieves it by considering just the first time the `user_id` appears in the dataset, counting these and finally doing a runningSum on these counts.

---

<div class="post-metadata">

**Author:** ![lillie](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@lillie](https://community.amazonquick.com/u/lillie)\
**Post date:** [February 21, 2022, 8:04pm UTC](https://community.amazonquick.com/t/how-does-runningdistinctcount-work-quick-sight-guide-has-no-instructions/1589/3 "2022-02-21T20:04:53Z")

</div>

Hi. runningDistinctCount() is in progress. We will hide this from the calculation editor for now. Thanks
