In a Flux statement, after using the pivot function for transformation, how can I get the number of rows? My purpose is to need this row count for pagination queries

After using the pivot function, using the count function results in an error. How can I correctly retrieve the result? Is there a more efficient way to find the number of rows after the row-to-column transformation?

runtime error @7:8-7:15: count: column “_value” does not exist

from(bucket: “init”)
|> range(start: -25h)
|> filter(fn: (r) => r[“_measurement”] == “ioe_testdb3”)
|> group(columns: [“driverid”])
|> sort(columns:[ “_time”], desc: true)
|> pivot(rowKey:[“_time”,“deviceid”], columnKey: [“_field”], valueColumn: “_value”)
|> count()

pivot() does not generate a column labeled _value. You might want to remove |> count() to inspect the columns generated by pivot(), and then use a specific column name like count(column: "mycolumn").