How to add a new relative column in Flux Query?

Above the data I structuring with flux query.

My requirment is to add a new column call middle for which the value will be the common value in target and source column.

How to achieve this result with flux query ?
Also a transformative feature example of grafana will also be helpfull.

Can you explain more precisely what you mean by " new column call middle for which the value will be the common value in target and source column."?

I want to create the above Sankey diagram. For this to work, I need to have one more column in the above data source (For now, lets call it “middle”). That column value must be, common value of source and target. So, basically if the target contains a value (Node A → Node C), and if the same value is being used as source (Node C-> Node D), then create it a center node for continuous flow (Value will be Node C).

I hope this clears the issue.

Hi @derickpintotest

Thanks for the explanation, but it’s still not really clear to me. Since your question is more about how to modify your Flux query, I suggest you post it to the InfluxDB forum as there will be more readers who might be able to help you.