Select the first entry from grouped data


i try to group some data into groups with the same ID and then select only the first entry.
I tried to do this with the following Query

from(bucket: "Bucket")

  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)

  |> filter(fn: (r) =>

    r._measurement =="MyMeasurement"


   |> pivot(


    columnKey: ["short","_field"],

    valueColumn: "_value"



|>rename(columns: {id: "ID"})

|>group( columns: ["ID"]


The problem is i only get the following error:
What can i do to achive my goal?

Thank you in advance.

@Patse first() has a column parameter that defaults to _value. After pivoting your data, the _value column doesn’t exist. All you need to do is provide a column name to first that does exist:

    |> first(column: "_time")

Thank you so much. I tried something similiar but i wrote it like in the group() function
|> first(column: ["_time"])

Can you tell me why the functions use different brackets? For example group() uses , rename uses {}.
Is there a reason for this?

The brackets are used to represent different Flux composite data types:

// An array or list (collection of values of the same type)
["string1", "string2", "string3"]

// A record (collection of key value pairs where the key is always a string
// and the value can be any data type
{foo: "bar", baz: 12}

// A dictionary (collection of key value pairs where the key can be any data type
// but all keys must be the same data type. Values can be any data type, but all
// values must be the same data type.
[1: "foo", 2: "bar", 3: "baz"]

You can learn more about Flux data types in the docs: