How to create a new dimension in Tableau which will incorporate only some selected values of the original dimension? Should I use the IF Contains statement to isolate some attributes from a dimension?

  • Tableau FAQs
  • December 11, 2018
Get Started Transforming Your Data in Snowflake

To create a new dimension in Tableau, you can use an IF expression with any other function. For example, in the previous question, a case was considered where IF was used in conjunction with CONTAINS and STARTWITH, but you can also use other functions. Next, using an example, we will look at what other functions you can use IF and how it works.

The first use case is to select numeric values from a selected field. So, for example, we can use conditional operators to display only the values we need in a new dimension:

IF [ProductIDGroup]='Other' THEN [OrderQty] ELSE NULL END

IF [ProductIDGroup]=’Other’ – in this expression, we are filtering only the ProductGroup value equal to “Other.”

THEN [OrderQty] – if the previous condition is TRUE, then we print OrderQty. You can display any other field, for example, ProductID.

ELSE NULL END – if the condition is FALSE, then we output NULL and end the expression using the END function

17.01 Tableau


Up Next:

Read How to calculate sum of distinct values in Tableau?

Related Posts

Top 5 Snowflake tools for Analysts- talend

Top 5 Snowflake Tools for Analysts

  • Ndz Anthony
  • February 26, 2024