TL;DR InfluxDB Tech Tips: Multiple Aggregations with yield() in Flux
The yield() function determines which table inputs should be returned in a Flux script. The yield() function also assigns a name to the output of a Flux query. The name is stored in the default annotation. For example, if we query the following table: Without the yield function: The following Annotated CSV output is returned. Notice the default annotation is set to _results by default. Now if we add the yield() function: The following Annotated CSV output is returned.