Flux - Append calculated field (percentage) and combine with results from different datasets

I’ve also noticed the question [How to calculate difference between min and max with Flux?](How to calculate difference between min and max with Flux?], which uses a join().

But my poor attempt below results in an undesired empty array:

        join(tables: {{totals: totals, onlines: onlines}}, on: ["total_count", "online_count"])
        |> map(fn: (r) => ({{ r with _value: r._value_online_count / r._value_total_count * 100 }}))
1 Like