英文:
Goggle Sheets Dashboard Comparison Chart feature
问题
我不知道这是否可能,或者如何解决这个问题。
我有一个包含9列的表格,第一列是Name-Eng-Esp-Fra-Ger-Rus-Ukr-Chi-Hin。
在仪表板上,我希望用户可以选择要比较的数据列。例如,我想要查看德语列和俄语列的比较图表。然后,图表将反映出仅比较这两列的柱状图。
每当我认为我知道如何处理时,我就会陷入困境...
English | German | French | Chinese | Ukrainian | Hindi | Spanish | Russian | |
---|---|---|---|---|---|---|---|---|
Please | 5 | 7 | 1 | 2 | 8 | 2 | 9 | 6 |
Thank you | 1 | 6 | 3 | 4 | 12 | 5 | 7 | 3 |
Good Day | 3 | 3 | 9 | 8 | 2 | 4 | 12 | 2 |
Your Welcome | 2 | 10 | 4 | 1 | 5 | 7 | 1 | 5 |
英文:
I don't know if this is possible, or how to tackle it.
I have a table with 9 columns the first is Name-Eng-Esp-Fra-Ger-Rus-Ukr-Chi-Hin
On the dashboard I would like to have viewer select the column Data comparison. I.E. I want to see a comparison chart for the German column and the Russian column. Then the chart now reflects a two bar graph comparing just those.
Everytime I think I know how approach it I get lost in the weeds...
English | German | French | Chinese | Ukrainian | Hindi | Spanish | Russian | |
---|---|---|---|---|---|---|---|---|
Please | 5 | 7 | 1 | 2 | 8 | 2 | 9 | 6 |
Thank you | 1 | 6 | 3 | 4 | 12 | 5 | 7 | 3 |
Good Day | 3 | 3 | 9 | 8 | 2 | 4 | 12 | 2 |
Your Welcome | 2 | 10 | 4 | 1 | 5 | 7 | 1 | 5 |
答案1
得分: 0
我相信我根据你提供的数据这里创建了一个示例。
基本上,你想根据用户输入创建一个动态数据范围。假设你在B10单元格中有一个下拉菜单,并且你的完整数据集(包括列标题和行标签)在A1:I5范围内。最初,B10是空的,但如果用户选择了“Chinese”(应该与你的某个列标题完全匹配),你可以使用以下公式获取相应行的数据:=iferror(index($B$2:$I$5,,match(B$10,$B$1:$I$1,0)))
(公式在B11单元格中)。
如果你将图表连接到与动态填充数据对应的范围,那么当用户进行更改时,图表将自动更新。几点注意事项:
- 标题不会自动更新,所以如果你使用标题的话,最好使用通用的标题(但图例会相应更新)。
- 如果数据不均匀,你需要确保图表的数据范围反映出可能的最大数据范围,以免意外裁剪数据。
英文:
I believe I mocked up an example based off the data you provided here.
Essentially, you want to create a dynamic data range based on user input. So say you have a drop down in B10 and you have your full data set (including column headers and row labels) in the range A1:I5. Initially B10 is empty, but if a user selects Chinese (which should identically match one of your column headers), you can grab the data corresponding to that row with the following formula: =iferror(index($B$2:$I$5,,match(B$10,$B$1:$I$1,0)))
(with the formula ia B11).
In case you are unfamiliar with some of the formulas (starting from the inside out):
- match - just searches for the position of a particular item in a range (in this case searching for the text "Chinese" within the range of column headers from the full data set)
- index - traditionally this grabs one item in a range according to a provided row and cell index, but if you skip the row argument and only provide a column argument, then it returns the entire column
- iferror - simply returns a blank cell if there is an error (just for a nicer UI)
If you connect the chart to the range that corresponds to the dynamically populated data then the chart will automatically update when the user makes changes. A couple notes:
- The title will not update automatically, so you'll want to make that generic if you use it at all (the legend though will update accordingly)
- In case the data is uneven, you'll want the data range on the chart to reflect the largest possible range of data so nothing gets accidentally clipped.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论