Quicksight:更改数据集的数据源
我的组织正在寻求更改BI工具,我正在努力快速地重复当前实施的数据模型和仪表板。
在我们的情况下,数据在整个客户端的建模完全相同。每个客户都有自己的单独数据库(数据源),这是完全相同的结构。在我们当前的工具中,我可以复制一个“数据集”,然后使用该特定客户端的正确数据库信息更新重复数据集的数据源。从模板创建新数据集后,我们进入并更新新数据集以调整客户特定自定义。
我已经弄清楚了如何复制数据集和仪表板,但是我无法弄清楚如何或是否有可能更改任何重复的数据集的数据源。
My organization is looking to change BI tools and I'm working on duplicating the currently implemented data models and dashboards over in Quicksight.
In our case, the data is modeled exactly the same across clients. Each client has their own separate database (data source) which is the exact same structure. In our current tool, I'm able to copy a 'Dataset' and then update the duplicate Dataset's data source with the correct database information for that specific client. Once the new dataset is created from the template, we go in and update the new data set to adjust for client specific customizations.
I've figured out how to duplicate Datasets and Dashboards, however I'm unable to figure out how, or if it's even possible, to change the data source for any of the duplicated datasets.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
可悲的是,这是Quicksight UI中不可能的。
在快速的UI中,可以手动创建新的数据源,然后从该数据源创建数据集,如果数据集为简单的SQL查询等,则可以将查询复制。但这不会在任何过滤器,计算的字段等上复制,这就是我怀疑您想做的。
我们使用使用AWS lambda函数中的Python脚本从我的BI开发环境中编程新的和更新的数据集和数据源到我们的生产环境。但是,只要您的用户帐户拥有所有相关的AWS权限以供快速观看,您就可以简单地从自己的终端 /编码环境中完成所有操作。
CLI具有您需要的命令,例如 create-data-source 和create-data-stet。 CLI还支持A 除了Python。
使用QuickSight UI,我将设置我的第一个数据源,数据集,并创建基本分析(使用通用过滤器,计算的字段,可视化等),并将其保存为仪表板。一旦完成了所有操作,您就可以使用AWS快速CLI到 create-template :
然后,我将使用AWS CLI获取您上面创建的数据集的元数据(list-data-set-> descript; descript-data-set)。然后,将(Python)脚本与所有客户数据库详细信息的一些字典一起为每个客户创建数据库详细信息。然后使用list-data-源,以获取所有数据源 - > ARN,最后使用脚本为每个客户创建数据集,每次替换DataSourCearn(我们使用在循环中“易于更新”的字典)。
希望这给你起点,欢呼
This is not possible AFAIK in the Quicksight UI, sadly.
In the Quicksight UI it is possible to create a new Data Source manually and then create Datasets from that Data Source and if the Dataset was a simple SQL query etc you could just copy the query across. But this will not copy across any filters, calculated fields etc and that is what I suspect you want to do.
We use the AWS Quicksight CLI version 2 to programmatically deploy new and updated Datasets and Data Sources to our Production environment from my BI development environment using Python scripts inside AWS Lambda functions. You can however simply do it all from your own terminal / coding environment as long as your user account has all the relevant AWS permissions for Quicksight.
The CLI has the commands you would need e.g. create-data-source and create-data-set. The CLI also support for a variety of languages in addition to Python.
Using the Quicksight UI I would set up my first Data Source, Dataset(s) and also create a base Analysis (with common Filters, Calculated Fields, Visualisations etc) and save that as a Dashboard. Once all that is done you can use the AWS Quicksight CLI to create-template:
Then, I would use the AWS CLI to get the metadata for the Dataset you created above (list-data-sets -> describe-data-set). Then using (Python) script with some dictionaries of all your customers Database details to create-data-source for each. Then use list-data-sources, to get all the DataSources -> Arn, and finally use a script to create-data-set for each customer, replacing the DataSourceArn each time (we use dictionaries which are 'easy' to update in a loop).
Hope this gives you a start, Cheers
您应该首先使用一个新名称(另存为:)保存分析
则应该打开新的分析并用新的数据集替换现有数据集:
< img src =“ https://i.sstatic.net/vctmf.png” alt =“在此处输入图像说明”>
选择替换:
您的数据集,仪表板应该可以使用新数据。
You should first save your Analysis with a new name (Save As:)
Then you should open new analysis and replace existing dataset with a new one:
Choose replace:
If only you have the same structure of your dataset, your dashboard should be O.K. with new data.
我必须使用命令行工具来更新
QuickSight aws aws aws aws aws cli aws cli cli参考
代码>&lt; aws-account-id&gt; 通常是标识您的AWS帐户的12位数字。
列出数据源
您可以使用它来获取以更新数据源的参数的模板:
(我使用JSON文件来更新参数)
使用适用的数据源信息编辑文件,然后使用以下方式更新:
I had to use the command line tool to update it
quicksight aws cli reference
Note: The
<aws-account-id>
below is typically a 12 digit number that identifies your aws account.List data sources
You can use this to get a template of the parameters to update a data source:
(I used a json file to update the parameters)
Edit the file with the applicable data source info then update with:
1.描述数据集并从输出
aws QuickSight Descrip-data-set -aws-account-id&lt; councelId&gt; gt; gt; gt; -DATA-SET-ID&lt; datasEtid&gt; (来自URL的DataSetID)
2. create update_dataset.json,并从(1)复制物理tablemap json。
在此JSON中更新DataSource ARN(新数据源)
3.UPDATE DATASET
aws QuickSight Update-data-set -aws-account-id&lt&lt; accountId&gt; -DATA-SET-ID&lt; datasEtid&gt; - 名称&lt; datasetName&gt; - 物理 - 桌映射文件://update_dataset.json - Import-Mode Spice
1.Describe Dataset and Get PhysicalTableMap json from output
aws quicksight describe-data-set --aws-account-id <accountid> --data-set-id <datasetid> (DatasetId from url)
2.Create update_dataset.json and Copy PhysicalTableMap json from (1).
Update DataSource Arn(new datasource) in this json
3.Update DataSet
aws quicksight update-data-set --aws-account-id <accountid> --data-set-id <datasetid> --name <DatasetName> --physical-table-map file://update_dataset.json --import-mode SPICE