Days since last visit as a calculated metric | Community
Skip to main content
mubarakd5726232
Level 4
November 25, 2020
Question

Days since last visit as a calculated metric

  • November 25, 2020
  • 1 reply
  • 1027 views

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 ? 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

yuhuisg
Community Advisor
Community Advisor
November 26, 2020

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).

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.