Expand my Community achievements bar.

Join us for the next Community Q&A Coffee Break on Tuesday April 23, 2024 with Eric Matisoff, Principal Evangelist, Analytics & Data Science, who will join us to discuss all the big news and announcements from Summit 2024!

Days since last visit as a calculated metric

Avatar

Level 5

We are capturing userids in a dimension so I'd like to create a report which for each userid shows (as a column) the "days since last visit" value 

How do I create this as a calculated metric

How do I factor in instances where users have had multiple cookies and thus would have multiple values ? 

1 Reply

Avatar

Community Advisor

If you want the "Days since Last Visit" number to be the values in each row, then you're not going to be able to do that. Which as you've probably discovered already.

One possibility is to construct a table like this:

Main dimension: user IDs

Main metric: Visits

  --> then drag the "Days since Last Visit" dimension under that "Visits" metric. Analysis Workspace automatically breaks up the single Visits metric column into multiple Visits metric columns, one for each "Day since Last Visit" value (up to a certain number of values).

Screenshot 2020-11-26 at 10.02.31 AM.png

To mitigate double-counting, you can create a metric "Approx UserIds Count", with a Calculated Metric:

APPROXIMATE COUNT DISTINCT(userId)

Then use that instead of the "Visits" metric that I had suggested.