Google 工作表查询 - ColX 的总和取决于 ColY
Google Sheets Query - Sum of ColX depending on ColY
所以我有以下数据:
|Country | Shop | Qty |
-----------------------------
|Austrailia | Shop 1 | 3
|Austrailia | Shop 2 |
|Austrailia | Shop 3 |
|Austrailia | Shop 4 |
|Japan | Shop 5 | 10
|Japan | Shop 6 | 1
|Japan | Shop 7 |
|Japan | Shop 8 |
|Japan | Shop 9 |
|Japan | Shop 10 |
|Austria | Shop 11 |
|Belgium | Shop 12 |
|Belgium | Shop 13 |
|Belgium | Shop 14 | 45
|Belgium | Shop 15 |
|Belgium | Shop 16 |
|Belgium | Shop 17 |
|Belgium | Shop 18 |
|Denmark | Shop 19 |
|Finland | Shop 20 | 2
我想在另一个选项卡中创建另一个 table 来查询此 table 并为我提供每个国家/地区不同商店数量行的总和。因此,例如,它会输出以下内容:
|Country | Qty
-----------------
|Austrailia | 3
|Japan | 11
|Austria | 0
|Belgium | 45
|Denmark | 0
|Finland | 2
我一直在使用 QUERY 命令,但无法让它输出我需要的内容:(
=QUERY(A1:C21,"Select A,sum(C) group by A",1)
所以我有以下数据:
|Country | Shop | Qty |
-----------------------------
|Austrailia | Shop 1 | 3
|Austrailia | Shop 2 |
|Austrailia | Shop 3 |
|Austrailia | Shop 4 |
|Japan | Shop 5 | 10
|Japan | Shop 6 | 1
|Japan | Shop 7 |
|Japan | Shop 8 |
|Japan | Shop 9 |
|Japan | Shop 10 |
|Austria | Shop 11 |
|Belgium | Shop 12 |
|Belgium | Shop 13 |
|Belgium | Shop 14 | 45
|Belgium | Shop 15 |
|Belgium | Shop 16 |
|Belgium | Shop 17 |
|Belgium | Shop 18 |
|Denmark | Shop 19 |
|Finland | Shop 20 | 2
我想在另一个选项卡中创建另一个 table 来查询此 table 并为我提供每个国家/地区不同商店数量行的总和。因此,例如,它会输出以下内容:
|Country | Qty
-----------------
|Austrailia | 3
|Japan | 11
|Austria | 0
|Belgium | 45
|Denmark | 0
|Finland | 2
我一直在使用 QUERY 命令,但无法让它输出我需要的内容:(
=QUERY(A1:C21,"Select A,sum(C) group by A",1)