Solved

How can I filter by time from user properties

  • 1 July 2023
  • 4 replies
  • 331 views

I’m learning/testing the platform and I want to know if it’s possible and how to filter by a range of hour. Assuming the following test data (screenshot) on the property “sessionCreatedAt” it’s possible to perform a filter like “every event of Session Create between 20:00 and 23:00” ? 

 

It would be cool if exists any documentation/guide about how am I supposed to filter datetimes values.

 

icon

Best answer by Saish Redkar 3 July 2023, 06:51

View original

4 replies

Userlevel 7
Badge +10

Hi @Cherry Ramatis 

If you want to filter on daily session create events which occur between specific hours, then the “Event Hour of Day” property filter will be useful. Something like this demo chart. This makes sense if your sessionCreatedAt property reflects the event timestamp.

If not, then a simple comparison of your timestamp should work. Here, I’m using the the server upload time property having the similar format as your sessionCreatedAt property

Let me know if I have interpreted your question correctly. Hope this helps.

Sure it helps! This comparison absolutely works on my side, but if I want to search by only the time frame value like on your example "> 6h AND < 20h" without referring to the date I need to upload a numeric property like hour? I can't refer it from this ISO date alone?

Thanks for taking the time to respond!

Userlevel 7
Badge +10

The “Event Hour of Day” property is available on your events all the time if you just want to use that, but that’s based on the event timestamp and not your custom property of sessionCreatedAt.

Derived Properties allows you to extract your hour component from any custom ISO date /timestamp property that you are sending ( this is a paid feature ).

Alternatively, you can possibly try to use the glob match operator to match your hour pattern from the ISO date values if that’s easier.

Ok that makes sense! thanks a lot for the help

I think I have all the information needed moving forward

Reply