http://vizdiff.blogspot.com/2014/08/removing-unwanted-measure-names-from.html]
In one of my tasks, I needed to use measure names as quick filter, when we wanted to stack up multiple measures in one chart.
Here begs the question: how to give people the option of selecting only those measures that we want people to see? And we want to exclude the rest of measures. This is a question that someone asked a while ago and remains unsolved:
http://community.tableausoftware.com/ideas/1274
It is great that Tableau allows us to build filter quickly based on measure names, but it doesn't give us the flexibility to exclude or remove those measures we don't want. This is not the case for any other quick filters in Tableau. The official explanation is that the measure names are not a real dimension. It is generated dynamically. Personally I don't see why we can't treat it as a normal quick filter.
One technique is to simply right click on any unused dimension and hide it. You can hide any of the unused dimensions.
http://kb.tableausoftware.com/articles/knowledgebase/controlling-displayed-fields
Another simple solution is as follows. (It is found after an earlier method that requires custom SQL editing.) You may have to duplicate the data connection before you proceed, in case you need other measure names for other work sheets.
1.Right click on the data connection and select Edit Tables
2.Select the first Table alias (Sheet1$ in this example) and click Edit.
3.Check off the field aliases (measures) you don't need. Then click OK. They will disappear from the Measures section.
4.You might need to remove those Calculated fields in measures as well, such as =# Number of Records. Just right click on each of them and select Delete.Then you are done!
The following is published earlier that requires custom SQL code editing:
---------------------------
So, I needed to solve the problem for my job (I may get fired if I don't). Here is a solution I came up with:
- Right click on data source and select Edit Connection in the data section. Pick the table. Select Custom SQL.
- Edit the SQL code therein to exclude those measure names you don't need. The code is arranged in such a way that we can read one measure or one dimension per line. Even a layman can read the SQL code there. It shouldn't be that hard.
- Right click the data connection and refresh.
All those unwanted measure names will disappear from the Measures section.Then you can build a clean quick filter based on measure names that you handpicked to show.
Yes, you do have to edit a bit the SQL code, but it's really not that hard to do.
In case you need the other measure names in the same workbook, you can always duplicate the data connection and edit the duplicate's SQL code if necessary.
In the following example, I am opening data from an Excel file (DB connections are similar). Select "Custom SQL". Then remove four measures. You will see 6 measures showing in your workbook. Voila!
Hi I am using Tableau 9.3 desktop, and I can not see "Edit Tables..." on the dropdown menu when I right click on the data source. Am I doing something wrong or is the feature no longer available in 9.3?
ReplyDeleteRight click data source and edit it. You can hide some columns.
DeleteThx. Part 2 worked. Extremely helpful!
ReplyDelete