如何使用电源查询计算组合结果并放在单独的表中
我的表包含以下信息:
主机名 | 测试名称 | 结果 |
---|---|---|
host_01 | test-01 | Pass |
host_01 | test-02 | fail>失败 |
host_01 | test-03 | n/a |
HOST_01 | TEST-04 | PASS |
HOST_01 | TEST-05 | PASS |
host_02 | test-01 | Pass |
host_02 | test-02 test-02 | fail> faff |
host_02 | Test-03 | Fail |
Host_02 | Test-04 | Pass |
Now I want/need to transform this to the following result:
Host name | Num_of_Tests_per_Host | Num_Passed | Num_Failed | Num_N/A |
---|---|---|---|---|
Host_01 | 5 | 3 | 1 | 1 |
Host_02 | 4 | 2 | 2 | null |
我创建了查询以提取Disctinct主机列表并计算出不同的“测试名称 - 结果”的情况。但是我无法围绕如何合并这些查询来创建结果表。
这可能是“ Arggh ...我为什么没有想到!”解决方案,但似乎无法抓住它。
非常感谢。
I have table containing the following information:
Host name | Test name | Result |
---|---|---|
Host_01 | Test-01 | Pass |
Host_01 | Test-02 | Fail |
Host_01 | Test-03 | N/A |
Host_01 | Test-04 | Pass |
Host_01 | Test-05 | Pass |
Host_02 | Test-01 | Pass |
Host_02 | Test-02 | Fail |
Host_02 | Test-03 | Fail |
Host_02 | Test-04 | Pass |
Now I want/need to transform this to the following result:
Host name | Num_of_Tests_per_Host | Num_Passed | Num_Failed | Num_N/A |
---|---|---|---|---|
Host_01 | 5 | 3 | 1 | 1 |
Host_02 | 4 | 2 | 2 | null |
I created the queries to extract the disctinct host list and count the distinct "Test name - Result" occurances. But I can't get my head around how to merge these queries to create the results table.
This will probably be an "Arggh ... Why didn't I think of that!!!" solution, but can't seem to catch it.
Many thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
假设单元格内容为nulls而不是文字说null,
Assuming the cell contents are nulls instead of text saying null,
尝试一下:
Try this: