I need your support to create a table that starting from an observation date, returns me the volumes of contracts divided by state. The starting point is a table where logs are recorded in time stamp format. I need to create a date in DD/MM/YYY format, and then the count of practices based on the status present in the last daily log. Also, if on the day following the log entry, no status changes result, the status of the day should be taken I attach starting base and expected result. Thanks for those who can help me.