Hi,
I'm trying to find out how long time passes between visits on average, if it´s for example 3 years that lapse between visists for our average constituent. The background is that I wan't to set a definition for when we count a constituent as a lost customer. Preferably I'd like to do this in Analytics, but I can't figure out how. Does anyone have a solution to my problem?
Thanks,
Sofia
Chris Wallingford HI Chris - this is super helpful as I was looking for an approach on this as well. I just wanted to clarify - is this based on their attendance or orders? I'm trying to figure out the time in between individual orders that a constituent might place in a season. So just wanted to see if I should make any modifications for what you had outlined in your approach. Thanks!
Hi Michael,
If you swap out the [Performance Date] fields with the equivalent [Order Date] or [Attended Date] fields, you will get average time between orders or attendance.
Best,Chris
Thanks Chris. This will be super helpful!
I'm looking to adjust the formula to look at 'time between Attended Dates'. When I go to adjust the formula to reference attendance, not performance dates, I can't seem to replicate the formula:
When I delete 'Perf Year'
And substitute in Attended Date / Calendar Year
It gives me this error message:
I feel there's something I'm missing with my clicks.
HI Nathanael,
From that ATTENDED DATE dimension(table), instead of [Date] field, please try the [Calendar Year] field.
It yields some very large numbers. What needs tweaking?
Hi Nathanael,
There's a few things going on...
( [Max Calendar Year]
MAX ( [Calendar Year]
[Total Calendar Day of Year] )
[Calendar Day of Year] )
This portion of the formula for each [Constituent ID] is producing a unique value for every distinct attendance date so that we can compare their MIN attendance date with their MAX attendance date. We're doing this conversion of attendance date to a number because Analytics formulas don't support taking the MIN or MAX of a Date field in a formula, so we can't use that as a basis of comparison for constituents' attended dates.
Instead, if my first attended date was 2021-05-20 (the 140th day of 2021), and my last attended date was 2022-04-15 (the 105th day of 2022), we can use the [Calendar Year] and [Calendar Day of Year] to produce these values:
Altered into these numerical representations we can compare the difference between these MIN and MAX values as a count of days between them.
MAX ( [Calendar Year All Items] * 365 + [Calendar Day of Year All Items] )
We do not want the MIN / MAX of each field separately, as the the Max Calendar Day of Year could have occurred in a year other than the Max Calendar Year. So not this:
( [Max Calendar Year] * 365 + [Max Calendar Day of Year] )
The numerator then looks something like this:
SUM ( [Constituent ID] , MAX ( [Attended Date > Calendar Year > All Items] * 365 + [Attended Date > Calendar Day of Year > All Items] ) - MIN ( [Attended Date > Calendar Year > All Items] * 365 + [Attended Date > Calendar Day of Year > All Items] ))
SUM ( [Constituent ID] ,
MAX ( [Attended Date > Calendar Year > All Items] * 365 + [Attended Date > Calendar Day of Year > All Items] ) - MIN ( [Attended Date > Calendar Year > All Items] * 365 + [Attended Date > Calendar Day of Year > All Items] ))
And then I think your denominator looks correct as (the sum of all constituent's counts of unique attended dates) minus (the unique count of constituents).
Returns this:
I updated my comment above. I had MIN and MAX reversed, subtracting MAX from MIN rather then the other way around.