我对QLik / Sense,Big Query,Google Data Studio(及相关)有知识
我需要创建一个包含多个点的地图,每个点都将显示数据库中的数据(与点相关)
表格看起来像这样:
+------------+---------------------------+-----------+---------+-------+
| Store Name | Store Location (Long/Lat) | Product | Ordered | Sold |
+============+===========================+===========+=========+=======+
| Store 1 | XXX,XXX | Product 1 | True | False |
+------------+---------------------------+-----------+---------+-------+
| Store 2 | YYY,YYY | Product 1 | True | True |
+------------+---------------------------+-----------+---------+-------+
| Store 2 | YYY,YYY | Product 2 | False | True |
+------------+---------------------------+-----------+---------+-------+
因此,当您将鼠标悬停在“商店2”商店的地图上时,您将看到仅带有以下内容的弹出框:
+------------+----------+-----------+
| Product 1 | True | True |
+------------+----------+-----------+
| Product 2 | False | True |
+------------+----------+-----------+
然后存储1:
+------------+----------+-----------+
| Product 1 | True | False |
+------------+----------+-----------+
我尝试过:
任何建议,可以使用什么?
答案 0 :(得分:2)
任何建议,可以使用什么?
作为一种解决方法-您可以考虑在可视化数据之前进行一些额外的工作,例如以下示例(BigQuery Standard SQL)
#standardSQL
WITH `project.dataset.table` AS (
SELECT "Maria's Tortillas" Store, '-118.379096984863,33.9593620300293' Location, 'machaka breakfast burritos' Product, TRUE Ordered, FALSE Sold UNION ALL
SELECT "Maria's Tortillas", '-118.379096984863,33.9593620300293', 'chile relleno plate', TRUE, TRUE UNION ALL
SELECT "Anthony's Gift Shop", '-118.371124267578,33.9462585449219', 'LA commemorative trinkets', FALSE, TRUE
)
SELECT
ANY_VALUE(ST_GEOGFROMTEXT(CONCAT('POINT(', REPLACE(location, ',', ' '), ')'))) Store_Location,
Store Store_Name,
STRING_AGG(CONCAT(Product,' | ',CAST(Ordered AS STRING),' | ',CAST(Sold AS STRING)), ' *** ') Products
FROM `project.dataset.table`
GROUP BY Store
如果您在BigQuery Geo Viz Tool上方运行-您将获得类似
的信息要为视觉效果“增添趣味”,您可以添加一些其他功能:
#standardSQL
WITH `project.dataset.table` AS (
SELECT "Maria's Tortillas" Store, '-118.379096984863,33.9593620300293' Location, 'machaka breakfast burritos' Product, TRUE Ordered, FALSE Sold UNION ALL
SELECT "Maria's Tortillas", '-118.379096984863,33.9593620300293', 'chile relleno plate', TRUE, TRUE UNION ALL
SELECT "Anthony's Gift Shop", '-118.371124267578,33.9462585449219', 'LA commemorative trinkets', FALSE, TRUE
)
SELECT
ANY_VALUE(ST_GEOGFROMTEXT(CONCAT('POINT(', REPLACE(location, ',', ' '), ')'))) Store_Location,
Store Store_Name,
CONCAT(
'<table cellpadding="5" style="border-style:solid; border-width:1px;border-collapse:collapse;">',
STRING_AGG(CONCAT('<tr>',td,Product,'</td>',td,CAST(Ordered AS STRING),'</td>',td,CAST(Sold AS STRING),'</td></tr>')),
'</table>'
) Products
FROM `project.dataset.table`, UNNEST(['<td style="border-style:solid;border-width:1px">']) td
GROUP BY Store
因此,结果的格式会更好一些(如下图所示)
除非您会找到可以自己处理所有需求的工具,否则您也许可以采用这种“技术”
同时,请记住,不同的工具将以不同的方式对待这种变通方法-例如,如果您在Goliath中的两个脚本上运行-您将分别拥有:
和
此外,在Goliath中,Geo Visualization是内置功能,因此您可以在不离开BigQuery Tool的情况下以交互方式构建具有多个图层的地理可视化并组合来自多个查询的结果等。
披露:我是Potens.io工具套件(属于Goliath的一部分)的作者,产品所有者和领先开发者,我的SO档案中也清楚说明了该信息 >
答案 1 :(得分:1)