Hi @chrisboy68, There are lots of options presented, but combining @yuanliu's response with a conversion from bill_date to year and month gives the output closest to "ID Cost by month": | makeresults format=csv data="bill_date,ID,Cost,_time
6/1/25,1,1.24,2025-06-16T12:42:41.282-04:00
6/1/25,1,1.4,2025-06-16T12:00:41.282-04:00
5/1/25,1,2.5,2025-06-15T12:42:41.282-04:00
5/1/25,1,2.2,2025-06-14T12:00:41.282-04:00
5/1/25,2,3.2,2025-06-14T12:42:41.282-04:00
5/1/25,2,3.3,2025-06-14T12:00:41.282-04:00
3/1/25,1,4.4,2025-06-13T12:42:41.282-04:00
3/1/25,1,5,2025-06-13T12:00:41.282-04:00
3/1/25,2,6,2025-06-13T12:42:41.282-04:00
3/1/25,2,6.3,2025-06-13T12:00:41.282-04:00"
| eval _time=strptime(_time, "%FT%T.%N%z")
``` end test data ```
``` assuming month/day/year for bill_date ```
| eval Month=strftime(strptime(bill_date, "%m/%e/%y"), "%Y-%m")
| stats latest(Cost) as Cost by Month ID Month ID Cost
----- -- ----
2025-03 1 4.4
2025-03 2 6
2025-05 1 2.5
2025-05 2 3.2
2025-06 1 1.24 You can alternatively use chart, xyseries, etc. to pivot the results: | chart latest(Cost) over ID by Month ID 2025-03 2025-05 2025-06
-- ------- ------- -------
1 4.4 2.5 1.24
2 6 3.2
... View more