Yes this is possible (see the reference below) -
You create a secondary source that has the dimension name and its alias - Load the file as a secondary data source and create a relationship between the dimension name and its alias
Does that work for you?
Alias Field Values Using Data Blending
Tableau might want you to use Document API for this:
Unfortunately, updating / renaming fields is not there (yet).
So you may want to work-around
by converting your Datasource table
into Custom SQL (HiveQL) Select statement.
Then you'd be able to replace rows in the code like this:
 AS ,
 AS ,
to something like this:
 AS [column_a],
 AS [column_b],
and so on.
This would be a one-time copy-paste operation --
as soon as your datasource table DDL doesn't change.
Hope this could help a bit.
1 of 1 people found this helpful
The proposed solution (relinking as above link didn't work - Edit Primary Aliases ) works to alias field values, not field names.
There isn't native support for such an operation in Tableau. You do have a couple of options though. They are all workarounds and each will require a different skill level.
Here's your options, I've ranked them from easiest to hardest based on my personal opinion:
- I'd recommend you just do this once and save / export your connection in Tableau so you don't have to do it again - Export Data Sources
- Create a view in hive where you alias the field names
- Use Custom SQL in Tableau to connect to the table and re-alias the field names.
- Create a script to edit the XML definition of your workbook / TDS file.
- This would be pretty straight forward with a scripting tool like Python, but it could even be achieved with VBA macros in Excel if you desired.
- Each column in your TDS would look like;
<column caption='123' datatype='string' name='' role='dimension' type='nominal' />
you would need to change the caption to the friendly name so it looks like
<column caption='Column 1' datatype='string' name='' role='dimension' type='nominal' />
- Look into using PIVOT / UNPIVOT functions in Hive. You could create a process where you unpivot all columns into a deep row structure, then you could join that to your table containing the field name definition and repivot it to a wide table using your new aliases. I've done this with MSSQL, I'm not even sure it's possible in Hive as I don't have Hive specific experience.
Thanks Tom -
My Bad -
I'm dealing with something similar and I think your comments will help
Thanks for your options Tom.
From your answers, second and third options are out of scope for me as they are not the candidates for automation ideally.
I am not sure how to solve my issue using your first option. Are you suggesting me to have export the SECOND DATA SOURCE? In that case, it would be same as Jim's option which doesn't fit for my case. Isn't it?
Appreciate your reponse.
My first option was that you connect via Tableau as you normally would, do all your renaming by hand then export the datasource. Next time you wish to connect, you open your saved datasource and all the aliasing is already done.
The idea is to automate Tom. Any future column alterations should automatically reflect in Tableau.
Anyways, really appreciate your response.