1 Reply Latest reply on Nov 29, 2018 6:22 AM by Ombir Rathee

    Sliding window and distinct counts – how?

    Sebastian Deptalla

      Hello! :-)


      For hours I am trying to get a distinct count of user-Ids over a rolling time period and I just cannot get it to work. I already clicked and read every page in my google SERP regarding "tableau window COUNTD" and so on, but right now I am feeling first waves of desperation, since right now I am not the tableau specialist. ;-)


      The challenge is quite simple:


      I need a daily count of users that have been active within the 7 days before. The fields of my table are just timestamp and user_id. If I take the (daily) timestamp as dimension and try something like ...


      WINDOW_SUM(COUNTD([user_id]), -7, 0)


      ... as measure, then of course I get the sum of 7 different distinct counts, not of one distinct count over 7 days.


      How do I or how do you approach that little problem? I am quite sure, that's not the first question of that kind..., but to be frankly honest: As much as I love the idea and explanation bei Jonathan in https://community.tableau.com/thread/119179, well... I am not sure, my mind is processing that right.


      Thanks a lot! :-)