用折线图中的不同列表示2个不同指标 [英] representing 2 different metrics with different columns in line chart
问题描述
我正在准备一个数据工作室报告.数据工作室报告由以下几列组成:
I am preparing a datastudio report. The data studio report consists of the following columns below:
如图所示,它在特定的时间捕获指标数据.
As seen in the picture it captures metric data at a particular time.
The date range is set as the end_time
X轴代表 end_time 列,细分维度为 InstanceName 列,我正准备将其显示为折线图.
The X axis will represent the end_time column and the breakdown dimension will be InstanceName column and I am preparing to show it as line chart.
There are 2 metrics
readops 和 writeops 列.
I need to represent these 2 metrics as 2 different lines in the same chart so that the read and write operation fluctuations for the instance at a particular time can be easily viewed.
我不确定如何在Data Studio上表示这一点.如果它是1指标,我知道它是直接的.我可以将实例名称设置为细分维度,将 end_time 设置为维度,并将日期范围设置为end_time并可以表示它.但是要将2个指标表示为特定实例的2条不同线,并在x轴上显示时间范围,所以我不知道,因为我对datastudio非常陌生.我想不进行深入研究.类似于我从Google云控制台获得的下图,其中在红色中为 WriteBytes 显示了 ReadBytes 大三角形和底部的较小三角形. 谁能帮我?谢谢
I am not sure on how to represent this on data studio. If it is 1 metrics, i know it is straight forward. I can set instancename as breakdown dimension and end_time as dimension and date range is set to end_time and can represent it. But to represent the 2 metrics as 2 different lines for a particular Instance, with the time range on x axis, i don't know as I am very new to datastudio. I want to do it without drill-down. similar to the picture below which I got from google cloud console which shows ReadBytes the Big Triangle and the smaller one at the bottom in red for WriteBytes Can anyone help me? Thanks
推荐答案
有两种基于图表显示方式的方法:
There are two approaches based on how the the charts need to be displayed:
如果目标是仅显示2行(2个指标):
If the aim is to only display 2 lines (2 Metrics):
-
readops
-
writeops
readops
writeops
在允许用户选择所需的InstanceName
的同时,可以使用过滤器控件(可选,具有默认选项).
While allowing the user to select the required InstanceName
, then a Filter Control (optionally with a default selection) could be used.
该图表将使用:
- 尺寸 :
end_time
- 指标#1 :
readops
- 指标#2 :
writeops
- Dimension:
end_time
- Metric #1:
readops
- Metric #2:
writeops
可编辑的Google Data Studio报告和一个GIF在上面展开:
Editable Google Data Studio Report and a GIF to expand on the above:
如果目标是为每个InstanceName
值以及两个指标(readops
和writeops
)显示一行,那么下面的方法将是一种方法.
If the objective is to display a line for each of the InstanceName
values as well as both the Metrics (readops
and writeops
), then the below approach would be one way.
当前,当使用细分维度时,Google Data Studio图表(例如时间序列图表)支持单个指标.
Currently, when using a Breakdown Dimension, Google Data Studio charts (such as a Time Series chart) support a single metric.
根据问题中的屏幕截图,使用以下数据集(可编辑的Google表格):
Using the Data Set below, based on the screenshot in the question (Editable Google Sheets):
一种方法是在数据上创建并使用多个 CASE
语句来源;例如:
One approach is to create and use multiple CASE
statements at the Data Source; for example:
-
readops_dum
CASE
WHEN REGEXP_MATCH(InstanceName, "(dum)") THEN readops
ELSE NULL
END
-
writeops_dum
CASE
WHEN REGEXP_MATCH(InstanceName, "(dum)") THEN writeops
ELSE NULL
END
等...
可编辑的Google Data Studio数据源和图像详细说明:
然后可以使用end_time
作为维度并使用新创建的度量标准来创建统计图; 可编辑的Google Data Studio报告和图像使用时间序列图表进行可视化:
A Chart could then be created with end_time
as the Dimension and using the newly created Metrics; Editable Google Data Studio Report and an image to visualise with a Time Series chart:
这篇关于用折线图中的不同列表示2个不同指标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!