Hi everyone,
I have three fields: Site name, service provider and a timestamp. essentially I can see who is the service provider in each site at any given timestamp (goes down to a minute resolution).
However, I am interested only in the latest service provider.
Thus, a calculation that looks at the latest time stamp and retrieves the service provider and associated site.
So I can have a list of site and provider and being sure it is the latest one.
Thanks
1 Like
Hello @Etai, we can make this work utilizing the maxOver function and partitioning the value by the site name field. I’ll write the example below:
ifelse(maxOver({timestamp}, [{site name}], PRE_AGG) = {timestamp}, {service provider}, NULL)
Using maxOver will let you retrieve that max timestamp for each site name, then you can match it to your timestamp in the dataset to return the service provider linked to that row. I’ll mark this as the solution, but please let me know if you have any remaining questions. Thank you!
1 Like
Thanks very much, it worked perfect ![]()