This won't work as you want | stats latest(Deployed_Data_time) AS Deployed_Data_time values(env) AS env max(latestVersion) AS latestVersion BY app latest() function is based on the _time field, so if you want Deployed_Data_time to be _time then you need to evaluate it | eval _time=strptime(Deployed_Data_time,"%m/%d/%Y %H:%M") but you also cannot do max(latestVersion) as that is simply doing a numeric comparison on the date, which is a string, so 4/16/2024 is LESS than 9/15/2023 - 4 is less than 9. If you ever want to do string based date comparisons, you need them to be ISO8601, i.e. YYYY-MM-DD-HH:MM:SS So, using your example data, is this what you want? | makeresults format=csv data="Deployed_Data_time,env,app,version
4/16/2024 15:29,axe1,app1,v-228
4/16/2024 15:29,axe1,app1,v-228
9/15/2023 8:12,axe1,app1,v-131
9/15/2023 8:05,axe2,app1,v-120
9/12/2023 1:19,axe2,app1, v-128
4/16/2024 15:29,axe2,app2,v-628
4/16/2024 15:26,axe2,app2,v-626
9/15/2023 8:12,axe2,app2,v-531
9/15/2023 8:05,axe1,app2,v-530
9/12/2023 1:19,axe1,app2, v-528"
| rex field=version "v-(?<v>\d+)"
| stats max(v) AS version BY app env
| table app,version,env
| chart values(version) by app, env limit=0
| fillnull value="Not Deployed"
... View more