Calculated field: flux query

I have distance and time column in influxdb using this i have computed the “Speed” Variable by writing the Flex query. But there is no value for this new field “Speed” in influxdb.Is it possible to take this variable in Visualization without having this field in Influxdb?

Welcome @nagashree

This might help you out.

// ...
    |> map(fn: (r) => ({ r with _value: r.A * r.B }))

Thank you. Here it is the scenario for 2 Measurements.
But for me i have only one measurement and in that how can i add new field with value?

    |> map(fn: (r) => ({ r with newColumn: r._value * 2 }))
1 Like