Hi, I'm facing an issue with calculating metrics i...
# ask-questions
m
Hi, I'm facing an issue with calculating metrics in an experiment where I need to group by day. To convert the timestamp to a day, I'm using the
toDate()
function. However, this results in all the timestamps being shifted to the start of the day (12 AM), which causes the metrics to be counted only from the next day, since the experiment started later than 12 AM. Additionally, some users are completely excluded from the experiment. I found a temporary solution by shifting the timestamp to the end of the day using the following expression:`timestamp::date + interval '1 day' - interval '1 second'`. That said, this feels like a workaround and not the most optimal approach. Is there a more appropriate solution you could suggest? Thanks in advance for your help!