如何在 Tableau 中将维度转换为度量 [英] How can I convert a dimension into a measure in Tableau

查看:35
本文介绍了如何在 Tableau 中将维度转换为度量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Tableau 界面快照

我有一个与 Tableau 相关的技术问题.我在维度部分有一个类别字段,其中包含三个指标:可支配收入、GDP 和消费者支出.我想将可支配收入"转换为自己的衡量价值.可以这样做吗?

I have a technical question relating to Tableau. I have a Category field in the dimensions section which has three indicators: Disposable Income, GDP and Consumer Expenditure. I would like to convert 'Disposable Income' into a measure value on its own. Is this possible to do?

推荐答案

是的,您可以,但我不确定您为什么要这样做.我想我需要多了解一下上下文.

Yes, you can but I am not sure why you would want to do that. I guess I need to understand the context a bit more.

将可支配收入转换为度量:

To convert Disposable Income into a measure:

  1. 使用以下值创建一个计算字段:名称: 可支配收入公式:IF [Category] ​​= 可支配收入"然后[类别]结束

  1. create a calculated field with the below values: name: Disposable Income formula: IF [Category] = "Disposable Income" THEN [Category] END

右键单击您创建的新可支配收入字段,然后选择转换为度量.

right click on the new Disposable Income field you created and select convert to measure.

度量应该是你可以聚合的东西,例如sum、average 等等,所以如果你把一个字符串作为一个度量,它会默认创建一个你可以改变的字段的计数.

Measures are supposed to be things that you can aggregate e.g. sum, average etc. so if you put a string as a measure it will by default create a count distinct of that field which you can change.

这篇关于如何在 Tableau 中将维度转换为度量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆