I expected the pivot function to take the “phase” values and populate them into the “a”, “b”, “c” and “net” columns in the same time rows, but they still have their own rows?
Can anyone tell me what I’m doing wrong? (I’ve also tried putting a “group()” in between the “keep” and “Pre” yield, which reduces the number of tables in the “Pre” output to just one, but the “Post” output is still the same).
Hi @tjs000,
Sorry for the late reply. I have done some further digging and still can’t quite work out the issue. @Anaisdg do you have any idea what might be happening here?
Had to find a way to work around it, did this by changing the order in which I processed the data (that has other benefits as well).
Set up an aggregation task in InfluxDB that runs every 5 minutes to aggregate the data, then used literally the identical pivot query on the new measurement and it works fine to pull the required data out in the right format.
I still don’t have a clue why it doesn’t work on the original data, it clearly should as demonstrated by Tom above, yet it doesn’t so
I guess to replicate this workaround in the future, do an arbitrary aggregation (ie a “mean” with a window period covering 1 data point) on the data then pivot it. It might work, it might not, who knows…