简体   繁体   English

How to make a dynamic tableau x-axis that gets changed when a different dimension is selected as a filter?

[英]How to make a dynamic tableau x-axis that gets changed when a different dimension is selected as a filter?

I am trying to create a report for my stakeholders where we want to check the distribution by values of column1, column2 and likewise.我正在尝试为我的利益相关者创建一份报告,我们希望通过 column1、column2 等的值检查分布。 While I could make different tabs for each column, I apparently have 55 columns ( all numeric and I will be making bins for them ) that the user want to toggle between for comparison on distributions - and coming up with an insight like column 43 is more skewed than column19.虽然我可以为每一列制作不同的选项卡,但我显然有 55 列(都是数字,我将为它们制作垃圾箱),用户想要在它们之间切换以比较分布 - 并且想出像第 43 列这样的见解更多比 column19 偏斜。

Pet example:宠物示例:

1. Suppose I have data in below format: 1.假设我有以下格式的数据:

在此处输入图片说明

2. And I want to create a tableau filter enabling the user to toggle between continents and countries, and get their individual distributions in the same view. 2.我想创建一个画面过滤器,使用户能够在大洲和国家之间切换,并在同一视图中获得他们的个人分布。 I want to keep the measure consistent (population in this example).我想保持测量的一致性(在这个例子中是人口)。 Something like below:像下面这样:

在此处输入图片说明

3. and generating distribution by continent when continent is selected and by country when country is selected 3.选择大洲时按大洲生成分布,选择国家时按国家生成分布

在此处输入图片说明

I know if I had wanted to toggle between different measures for the same dimension, then I needed to create parameters, but this is opposite to it (same measure but different dimensions) and I am not able to figure out.我知道如果我想在同一维度的不同度量之间切换,那么我需要创建参数,但这与它相反(相同的度量但不同的维度),我无法弄清楚。

Any comment/help will be much appreciated.任何评论/帮助将不胜感激。

I'm afraid you'd still need to use parameters.恐怕您仍然需要使用参数。 There is no equivalent of Measure Names for dimensions so you'll have to create a parameter (I called it Dimension Switch ) with Continent, Country, etc. as options and a calculated field that will look something like this:维度没有等效的Measure Names ,因此您必须创建一个参数(我称之为Dimension Switch ),其中包含 Continent、Country 等作为选项和一个计算字段,看起来像这样:

CASE Dimension Switch
  WHEN "Continent" THEN [Continent]
  WHEN "Country" THEN [Country]
END

This calculated field will take on the values of whichever column you have selected in the Dimension Switch parameter.此计算字段将采用您在Dimension Switch参数中选择的任何列的值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM