One other question came up: I found one article su...
# gooddata-platform
t
One other question came up: I found one article suggesting an “event-based Data Model” in order to enable using multiple timestamps in a single insight: https://help.gooddata.com/classic/en/dashboards-and-insights/maql-analytical-query-language/maql-use-cases-and-tutorials/generate-cohort-report/ We additionally want to build cohort diagrams. There is another article describing that: https://help.gooddata.com/classic/en/dashboards-and-insights/maql-analytical-query-language/maql-use-cases-and-tutorials/generate-cohort-report/ However, the datamodel in the cohort article uses two separate dates. Is it possible to build cohorts based on a event based data model as well?
i
Hi Thomas, I assume that you meant this secondary article, but correct me if I am wrong, please. https://community.gooddata.com/metrics-and-maql-kb-articles-43/cohort-analysis-775 However, both scenarios work with two date dimensions.
t
j
Hi, You can probably use hybrid model with event based data and additional “cohort dimension” implemented using pre-computed regular attribute (e.g. age for cohorts defined by age) or date dimension. For convenience of business users it is probably better to have a separate dimension for cohort analysis. You can also define separate metrics for individual cohorts with event based model using MAQL. For example metric which shows “visit” events in time for subscribers who had “subscription” event this year may look like this:
Copy code
select count(Event Id) where Event Type=visit and (select count(Event Id) by Subscriber Id, all other where Event Type=subscription and Year (Event Date)=THIS without parent filters)>0
If you need to display multiple cohorts in one insight you may use multiple metrics. I think this is less convenient for users because you need to offer multiple metrics in data catalogue compared to one cohort attribute/date dimension. In GD platform you may also consider using computed attributes for cohort definition. You need metric for this (e.g. “age” which calculates number of months since subscription) and then you can create computed attribute for “subscriber id” and define the cohorts by ranges of age. I think this can be done with event based model as well. You have many options and it is up to you to select the one which works the best for your use case and your users.
🙌 1
t
Very nice, thanks a lot!
p
🎉 New note created.
i
t
Definitely!
👍 1