Round up the values in a specific column

Hey,
i calculate a value into a new column and try to round up the calculated value.
I tried the math.ceil() function but i always get an error “missing pipe Argument”
Is there another way to get the rounded up value?

My Query is the following:

import “math”

from(bucket: “zone/autogen”)

|> range(start: 2021-01-01T00:00:00Z)

|> filter(fn: (r) =>

r._measurement == "Measurement2"

)

|> pivot(

rowKey:["_time"],

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

valueColumn: "_value"

)

|> filter(fn: (r) =>

r.articlenumber < "2500000000" or

r.articlenumber > "5000000000"

)

|>group(columns:[“day”,“week”])

|>sum(column:“orderQuantity”)

|> map(fn: (r) => ({ r with

neededmachines: float(v: r.orderQuantity)/6000.0

}))

|>group()

|>math.ceil(x:“neededmachines”)

Thank you for your help in advance

Hello @Patse,
You’re really close, nest the math.ciel in the map function

|> map(fn: (r) => ({ r with

neededmachines: math.ceil(x: float(v: r.orderQuantity)/6000.0)

}))

thank you so much for the reply.
why do i need

in the map function?

Forget the question. i was stupid and tired :sweat_smile:

@Patse, no worries! That’s me so often.