Adding tags to a new measuremnt


I have an aggregate function with an “where” clause and I want to store the result in an extra measurement:

select mean(field1) into measurement2 from measurement1 where tag1=‘xxx’;

Is there a way to include the tag “tag1” (=xxx) into the new measurement, so that I can make differentiations between the mean values on the basis of the tag?

Thanks a lot!

Hello @TomZastrow,
I don’t think you can add tags with the Into Clause. You can write it to a new measurement though. This blog might be useful to you.

Otherwise you can use set() in Flux in 2.0 to achieve that type of schema mutation.