diff --git a/docs/sources/panels/reference-transformation-functions.md b/docs/sources/panels/reference-transformation-functions.md index 818c7c449e0..39c417692ea 100644 --- a/docs/sources/panels/reference-transformation-functions.md +++ b/docs/sources/panels/reference-transformation-functions.md @@ -281,6 +281,40 @@ In "Rows" mode, the result has a table for each series and show each label value | Server | Server B | | Datacenter | EU | +### Value field name + +If you selected Server as the **Value field name**, then you would get one field for every value of the Server label. + +| Time | Datacenter | Server A | Server B | +| ------------------- | ---------- | -------- | -------- | +| 2020-07-07 11:34:20 | EU | 1 | 2 | + +### Merging behavior + +The labels to fields transformer is internally two separate transformations. The first acts on single series and extracts labels to fields. The second is the [merge](#merge) transformation that joins all the results into a single table. The merge transformation tries to join on all matching fields. This merge step is required and cannot be turned off. + +To illustrate this, here is an example where you have two queries that return time series with no overlapping labels. + +- Series 1: labels Server=ServerA +- Series 2: labels Datacenter=EU + +This will first result in these two tables: + +| Time | Server | Value | +| ------------------- | ------- | ----- | +| 2020-07-07 11:34:20 | ServerA | 10 | + +| Time | Datacenter | Value | +| ------------------- | ---------- | ----- | +| 2020-07-07 11:34:20 | EU | 20 | + +After merge: + +| Time | Server | Value | Datacenter | +| ------------------- | ------- | ----- | ---------- | +| 2020-07-07 11:34:20 | ServerA | 10 | | +| 2020-07-07 11:34:20 | | 20 | EU | + ## Merge Use this transformation to combine the result from multiple queries into one single result. This is helpful when using the table panel visualization. Values that can be merged are combined into the same row. Values are mergeable if the shared fields contain the same data. For information, refer to [Table panel]({{< relref "../visualizations/table/_index.md" >}}). @@ -324,40 +358,6 @@ In the example below, I hid the value field and renamed Max and Min. {{< figure src="/static/img/docs/transformations/organize-fields-stat-example-7-0.png" class="docs-image--no-shadow" max-width= "1100px" >}} -### Value field name - -If you selected Server as the **Value field name**, then you would get one field for every value of the Server label. - -| Time | Datacenter | Server A | Server B | -| ------------------- | ---------- | -------- | -------- | -| 2020-07-07 11:34:20 | EU | 1 | 2 | - -### Merging behavior - -The labels to fields transformer is internally two separate transformations. The first acts on single series and extracts labels to fields. The second is the [merge](#merge) transformation that joins all the results into a single table. The merge transformation tries to join on all matching fields. This merge step is required and cannot be turned off. - -To illustrate this, here is an example where you have two queries that return time series with no overlapping labels. - -- Series 1: labels Server=ServerA -- Series 2: labels Datacenter=EU - -This will first result in these two tables: - -| Time | Server | Value | -| ------------------- | ------- | ----- | -| 2020-07-07 11:34:20 | ServerA | 10 | - -| Time | Datacenter | Value | -| ------------------- | ---------- | ----- | -| 2020-07-07 11:34:20 | EU | 20 | - -After merge: - -| Time | Server | Value | Datacenter | -| ------------------- | ------- | ----- | ---------- | -| 2020-07-07 11:34:20 | ServerA | 10 | | -| 2020-07-07 11:34:20 | | 20 | EU | - ## Reduce The _Reduce_ transformation applies a calculation to each field in the frame and return a single value. Time fields are removed when applying this transformation.