Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone!
I've got a problem with counting distinct IDs (with 2 conditions) monthly and in accumulation.
Here is my table:
I want to get unique count of IDs with both flags = 1 for each month, but without repeating in future months. I mean, I need get, for example, 31 IDs in Jan 2019 and 204 IDs in Feb 2019 - so unique IDs of Feb 2019 don't include any unique IDs in Jan 2019.
So, currently I use two formulas for calculating unique IDs for every month (2nd column) and accumulate them (3rd column) - but I need to get 31 for Jan 2019, 204 for Feb 2019 (instead of 215 - which include some unique IDs from Jan), 221 in Mar 2019 (instead of 219 - which include some unique IDs from Jan and Feb) and so on. My incorrect results are in table below:
I attach a little another example for better understanding. Of course, I need here accumulation, too , so Jan -2, Feb - 4, Mar - 4 (only IDs with flag=1):
I want a solution in set analysis, without any AsOfTable because it's quite difficult to implement in my data model.
Lookin forward to get any help.
instead of 291 in Mar*