Solved

Comparing Date with "Today"

  • 22 March 2023
  • 3 replies
  • 203 views

Userlevel 2
Badge

I would like to be able to compare a User Property Date to “today”. For example, if I want a cohort of users who are currently “subscribed”, there doesn’t seem to be a reliable and automated option to do that. If I were able to compare dates within User Properties to “Today”, then I would be able to create a cohort that is something like: “subscription expiry > today”, and I could keep a cohort of all my subscribed users. This works for a specific day, but if the day I’m comparing to is dynamic, then it seems I’m out of luck. 

Another example is for Experiment. I want user who are “subscribed” to see a specific variant. Again, I don’t think that’s really possible without sending an event to Amplitude when the subscription expires, which seems unscalable. 

Maybe it’s possible, and I missed it somewhere? 

Thanks in advance,

Justin

icon

Best answer by Hadish 23 March 2023, 00:34

View original

3 replies

Badge +1

Hi Justin, currently, there isn't a direct way to compare a User Property Date to "today" within Amplitude. However, you can create a cohort based on a user property with a specific date range, such as "subscription expiry in the next 7 days". You can then update this cohort daily to keep track of all subscribed users whose subscription will expire in the next 7 days. As for your experiment example, you can use the same approach and create a cohort of subscribed users and target them with a specific variant. Alternatively, you can use an external tool to trigger an event in Amplitude when a user's subscription expires, and then use that event to target users in your experiment. I hope this helps!

Userlevel 2
Badge

This is how I thought the situation as well. Thanks for validating my understanding. Then I guess I would like to formally request this be a feature😀 I think it would be very useful, especially as Experiment being such an integral tool in the user experience. 

Userlevel 2
Badge

I realized in the Govern Packing (which we do not have) you can specify Derived properties. I believe this would have the effect we want it to. 

Reply