windowRunningCount calculation

Hi,

I’ll appreciate your advise about the below dataset & calculation.

transId date amount user
100001 12/06/2022 61 AAA
100002 10/06/2022 2 AAA
100003 08/06/2022 39 null
100004 08/06/2022 9 BBB
100005 07/06/2022 100 BBB
100006 07/06/2022 8 CCC
100007 05/06/2022 94 AAA
100008 02/06/2022 58 null
100009 02/06/2022 12 null
100010 31/05/2022 46 BBB
100011 30/06/2022 68 CCC
100012 30/06/2022 89 DDD

I would like to count distinct the number of users in a window of 7 days backwards.
the result will be for 12/06 & 05/06 dates for example-

date usersCountd
12/06 3
05/06 4

unfortunately, windowRunningCount didn’t solve it.

Thanks,
Amihai

Hi amico,

The easiest way to accomplish this would be to create a table with your date field and aggregate it by week. Then add your user field and take a discount count.