Quantcast
Viewing all articles
Browse latest Browse all 217217

Running Total Cohort

Hello

 

How to calculate running total for cohort? Using dates for running total calculation is stright forward, but I can't find solution for cohort. I have such data model:

Image may be NSFW.
Clik here to view.
Data Model.PNG


with such data

 Image may be NSFW.
Clik here to view.
Tables.PNG


 

 I want to create running total, so it never exceed count of days from Date Added to list till last date in dimDate table  (values in  column "Days Between DateAddedToList and MaxDateId", which prefferably should be defined as measure in running total calculation) regardless of the last date of dates in Date Transactions. So for an example - item C was added to list in 05. Aug. Last date in dimDate is 8.Aug, so running total should be only for 4 days.

Desired result is below: 
Image may be NSFW.
Clik here to view.
running_total_cohort.PNG


The problem - I can't specify this days count limit in calculation for running total..

 

 There is also link with data and model in Excel
data_for_running_total_cohort

 

Thanks BR


Viewing all articles
Browse latest Browse all 217217

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>