Akash Tyagi
Akash Tyagi

Reputation: 97

Range values in Tableau

I want to visualise the below excel table in Tableau.

enter image description here

When adding this table to Tableau it shows Salary values as String and thus under Dimension Tab and not under Measure, thus cannot make proper graph from it.

How to convert this Salary range values to Int ?

Upvotes: 2

Views: 1738

Answers (2)

Alex Blakemore
Alex Blakemore

Reputation: 11896

As @Alexandru Porumb suggested, the best solution is to have a min_salary column and a max_salary column — unless you really have the actual salary available which is even better.

If you don’t want to revise the incoming data, you can get the same effect using the Split() function in a calculated field from Tableau to derive two integer fields from the original string field.

For example, you could define a calculated field called min_salary as INT(SPLIT([Salary], ‘-‘, 1)). Split() extracts part of a string based on a separator string. Int() converts the string to an integer.

Upvotes: 1

Alexandru Porumb
Alexandru Porumb

Reputation: 11

You could simplify the way it sees the data and separate the salary column into Min and Max, thus you wouldn't have the hyphen that makes Tableau consider the entry as a string.

Simplistic idea, I know but it may help until a better solution will be provided.

Hope it helps

Upvotes: 1

Related Questions