将 2 个或更多数据集组合到同一个折线图 SQL Server 2008 R2
Combining 2 or more datasets onto the same Line Chart SQL Server 2008 R2
我对 SQL Report Builder 相当了解,我目前有四个不同的数据集,它们在 4 个折线图上显示数据。我希望能够将这些全部组合成 1 个具有 4 条不同线条的图表。
这是我对我的一个数据集的示例查询。
SELECT
QA_Automation_Datalogs_1.Log_Time,
QA_Automation_Datalogs_1.Y_Bed_Position,
FROM
QA_Automation_Datalogs_1
WHERE
QA_Automation_Datalogs_1.Location = @Plant AND
QA_Automation_Datalogs_1.Log_Time >= @start_date AND
QA_Automation_Datalogs_1.Log_Time < @stop_date AND
QA_Automation_Datalogs_1.Bed_Number = 1
ORDER BY
QA_Automation_Datalogs_1.Log_Time
对于不同的数据集,我将 WHERE Bed_Number 更改为 1、2、3 和 4。
然后我将床的位置绘制成时间的函数。我已经尝试同时使用 Lookup 函数和 JOIN/UNION 函数,但它们没有起作用(可能是由于某些语法错误)。我也无法更改数据在服务器中的排列方式。
抱歉,我忘了提及,在我获取数据后,我创建了一个计算字段 "Position" 并将其设置为等于 "Y_Bed_Position"。然后我绘制 Sum(Fields!Position.Value)。如果我像你向我展示的那样一次获得所有数据,我不确定如何将每张床加在一起。
我可能遗漏了一些东西,但据我了解你的问题,我认为这应该能得到你要找的数据。
SELECT
QA_Automation_Datalogs_1.Log_Time,
QA_Automation_Datalogs_1.Bed_Number,
QA_Automation_Datalogs_1.Y_Bed_Position,
FROM
QA_Automation_Datalogs_1
WHERE
QA_Automation_Datalogs_1.Location = @Plant AND
QA_Automation_Datalogs_1.Log_Time >= @start_date AND
QA_Automation_Datalogs_1.Log_Time < @stop_date AND
QA_Automation_Datalogs_1.Bed_Number in (1, 2, 3, 4)
ORDER BY
QA_Automation_Datalogs_1.Log_Time,
QA_Automation_Datalogs_1.Bed_Number
我对 SQL Report Builder 相当了解,我目前有四个不同的数据集,它们在 4 个折线图上显示数据。我希望能够将这些全部组合成 1 个具有 4 条不同线条的图表。
这是我对我的一个数据集的示例查询。
SELECT
QA_Automation_Datalogs_1.Log_Time,
QA_Automation_Datalogs_1.Y_Bed_Position,
FROM
QA_Automation_Datalogs_1
WHERE
QA_Automation_Datalogs_1.Location = @Plant AND
QA_Automation_Datalogs_1.Log_Time >= @start_date AND
QA_Automation_Datalogs_1.Log_Time < @stop_date AND
QA_Automation_Datalogs_1.Bed_Number = 1
ORDER BY
QA_Automation_Datalogs_1.Log_Time
对于不同的数据集,我将 WHERE Bed_Number 更改为 1、2、3 和 4。 然后我将床的位置绘制成时间的函数。我已经尝试同时使用 Lookup 函数和 JOIN/UNION 函数,但它们没有起作用(可能是由于某些语法错误)。我也无法更改数据在服务器中的排列方式。
抱歉,我忘了提及,在我获取数据后,我创建了一个计算字段 "Position" 并将其设置为等于 "Y_Bed_Position"。然后我绘制 Sum(Fields!Position.Value)。如果我像你向我展示的那样一次获得所有数据,我不确定如何将每张床加在一起。
我可能遗漏了一些东西,但据我了解你的问题,我认为这应该能得到你要找的数据。
SELECT
QA_Automation_Datalogs_1.Log_Time,
QA_Automation_Datalogs_1.Bed_Number,
QA_Automation_Datalogs_1.Y_Bed_Position,
FROM
QA_Automation_Datalogs_1
WHERE
QA_Automation_Datalogs_1.Location = @Plant AND
QA_Automation_Datalogs_1.Log_Time >= @start_date AND
QA_Automation_Datalogs_1.Log_Time < @stop_date AND
QA_Automation_Datalogs_1.Bed_Number in (1, 2, 3, 4)
ORDER BY
QA_Automation_Datalogs_1.Log_Time,
QA_Automation_Datalogs_1.Bed_Number