Distinct Count Over

Hi,

I want to use the function distinctCountOver - counting distinct IDs over a month (and adding this filed to a table that is not aggregated by month).
When I use count_over function I get results however when I use distinctCountOver I get an error.

countOver(ID,[extract(‘MM’,Timestamp)],PRE_AGG) - works
distinctCountOver(ID,[extract(‘MM’,Timestamp)],PRE_AGG) - error: Please correct the
distinctCountOver to use PRE_AGG or PRE_FILTER levels and partiton only by column references.

I am not sure what I am doing wrong and how to fix it.
What am I missing?

Thanks,

Hi @yeal,

the issue is the extract(‘MM’,Timestamp)

You can try to create a MM field extract(‘MM’,Timestamp) and use the field in distinctCountOver(ID,[{MM}],PRE_AGG)
BG

1 Like

Hi, @yael. We hope @ErikG’s solution worked for you. Let us know if this is resolved. And if it is, please help the community by marking this answer as a “Solution" (check box under the reply).