There are times where you want to visualize the underlying data set in different ways without having to pay the cost of the query each time. This sample shows you how to do so using the Merge
option in the query control.
-
Create an empty workbook.
-
Click
Add query
to create a query control.-
Data source:
Logs
-
Resource type:
Log Analytics
-
Log Analytics workspace: Pick one of your workspaces that has performance data
-
Log Analytics workspace Logs Query
Perf | where CounterName == '% Processor Time' | summarize CpuAverage = avg(CounterValue), CpuP95 = percentile(CounterValue, 95) by Computer | order by CpuAverage desc
-
Click the
Run Query
button to see the results. This is the result data set that we want to reuse in multiple visualizations. -
Go to the
Advanced settings
tab:- Step name:
Cpu data
- this gives a friendly name for referencing the data later.
- Step name:
-
-
Click
Add query
to create another query control. -
There are some table options for you here:
-
Use the
Name After Merge
column to set friendly names for your result columns.- For instance you can rename
CpuAverage
toCPU utilization (avg)
. - Use the
Run Merge
button to update the result set.
- For instance you can rename
-
Use the
Delete
button to remove a column.- Select the `[Cpu data].CpuP95 row
- Use the
Delete
button in the query control toolbar. - Use the
Run Merge
button to see the result set without the CpuP95 column
-
Change the order of the columns using the
Move up
orMove down
buttons in the toolbar. -
Add new columns based on values of other columns using the
Add new item
button in the toolbar. This option will be covered in a separate sample.
-
-
Style the table using the options in the
Column settings
to get the visualization you want. -
Add more query controls working against the
Cpu data
result set if needed. Here is an example that shows Average and P95 CPU utilization side by side.