First 12 Months Since Created Calculated Field

I am looking to for a calculated field that shows the number of views in the first 12 months since launch for multiple companies that have different launch dates, so that I can compare how companies stack up in their first month, second month etc.

The Date Dimension I have is the company_launch_date. The view number is calculated by a count of the view_id

1 Like

Hello @DataDude1, do you have another date field in your data, like view_date, that we could use to compare the company_launch_date to? If there is a field that we can use to determine whether or not a view_id is linked to a specific date, I can definitely help you build the calculation for this.

Hey Dylan. Thanks for replying. We have a view_created_date that is associated with every view ID. Sorry, I meant to include that.

1 Like

Hello @DataDude1, if that is the case, then we should be able to make this work. We can use the company_launch_date and the addDateTime function to check if the view dates occur within the range you are checking.

ifelse({view_created_date} >= {company_launch_date} AND {view_created_date} <= addDateTime(12, 'MM', {company_launch_date}), {view_id}, NULL)

As long as each view_id is linked to a row that also contains the company_launch_date, this calculation should only return view_ids for each company within the 12 month window. Let me know if this helps!

Hello @DataDude1, since we have not heard back from you in a few days, I will mark my above response as the solution. Please let me know if you have any remaining questions and I can guide you further. Thank you!

1 Like