Getting all columns

data = from(bucket: “meta_test_acs”)
|> range(start: -1h)
|> filter(fn: (r) => r._measurement == “meta_test_viewtime”)
Ttime = data
|> filter(fn: (r) => r._field == “Ttime”)
|> aggregateWindow(every: 1m, fn: sum)
|> set(key: “_field”, value: “Ttime”)
count = data
|> filter(fn: (r) => r._field == “count”)
|> aggregateWindow(every: 1m, fn: sum)
|> set(key: “_field”, value: “count”)
listSize = data
|> filter(fn: (r) => r._field == “listSize”)
|> aggregateWindow(every: 1m, fn: sum)
|> set(key: “_field”, value: “listSize”)
union(tables: [Ttime, count, listSize])
|> group(columns:[“_time”,“prd”,“viewtype”])
|> set(key: “_measurement”,value: “test_viewtime_1m”)
|> to(bucket: “test_acs”, org: “meta”)

Hi,
The output result must contains only the columns specified in the group operation, but my result give all columns. can anyone help me out.

Hello @vicki,
You can use the keep() function to retain the columns you want.
Which operation specifically and which columns are you returning and what do you expect?

1 Like

Thanks @Anaisdg
It’s working

1 Like