Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in displaying values after pivot #8

Open
joeri-s opened this issue Jun 17, 2024 · 0 comments
Open

Bug in displaying values after pivot #8

joeri-s opened this issue Jun 17, 2024 · 0 comments

Comments

@joeri-s
Copy link

joeri-s commented Jun 17, 2024

When querying the data in raw_data.csv, the values dissapear after the final pivot step. Adding the data to InfluxDB and doing the same query there confirms that the pivot results in the correct data. The fact that it doesn't show in Fluxtreme while it should be there, suggest some formatting or display bug.

Before pivot:

image

After pivot:

image

Data

raw_data.csv

The full query

import "date"

from(bucket: "kpi")
    |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
    |> filter(fn: (r) => r["name"] == "ms_distance")
    |> pivot(rowKey: ["_time"], columnKey: ["_field"], valueColumn: "_value")
    |> group(columns: ["_time"])
    |> map(fn: (r) => ({
        r with
            index: int(v: r.index),
            measurement_time: time(v: int(v: r.measurement_start*1000000000.0)),
            location: string(v: "(" + string(v: r.location_x) + ", " + string(v: r.location_y) + ")")
    }))
    |> keep(columns: ["index", "measurement_time", "location", "offset_value"])
    |> sort(columns: ["index"])
    |> pivot(rowKey: ["measurement_time"], columnKey: ["location"], valueColumn: "offset_value")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant