-
1. Re: Dimension with multiple data types?
Shawn Wallwork Sep 18, 2012 5:09 PM (in response to Susan Baier)Susan,
Try duplicating the field, then set one to numbers and the other to strings. Although having your data in this sort of shape will probably cause you headaches down the road. It would be cleaner if you created a new field in your data source for type of question: Multi-choice or Rating. And then replaced all your Always, Sometimes, Never strings with 1,2 & 3. That way everything is a number, and you can put the Type field on the filter shelf so you can separate them out. That's probably best practices, but the other way should work too.
--Shawn
-
2. Re: Dimension with multiple data types?
Susan Baier Sep 19, 2012 11:09 AM (in response to Shawn Wallwork)Hi Shawn, thanks for the quick response.
I tried duplicating the Dimension in Tableau, but the field type seems to stick to both the original and the duplicate, so I can't seem to make one a string and one a number.
I would duplicate in my original excel file, but I reshape the data using the excel plugin for Tableau and I can't figure out how to still do that and have two types of "Response" fields. (FYI the Always/Sometimes/Never example was just an example -- I have a bunch of different text strings for various RESPONSE items, and they're all different, so it's not as easy as just making them a number. I'd have to go through and assign different numbers to like 40 different possible responses).
I appreciate your help and would love to know any other ideas you have on how to solve this. Can I somehow differentiate the type between the original RESPONSE field and the new RESPONSE(copy) field that I created within Tableau?
-
3. Re: Dimension with multiple data types?
Shawn Wallwork Sep 19, 2012 11:18 AM (in response to Susan Baier)Hi Susan, let me poke around a bit. In the meantime, feel free to send me your Excel file and/or packaged workbook off-line. My email should be visible on my profile page. I'm sure we can work this out.
--Shawn
-
4. Re: Dimension with multiple data types?
Tracy RodgersSep 19, 2012 12:00 PM (in response to Susan Baier)
Hi Susan,
One one to do this is to edit the duplicate and use one of the Type Conversion functions in front of the field. Similar to the following:
str([Row ID])
Hope this helps!
-Tracy
-
5. Re: Dimension with multiple data types?
Susan Baier Sep 19, 2012 12:13 PM (in response to Tracy Rodgers)Thanks Tracy -- I'm kind of a newbie. Can you explain in a little more detail how to do this? Thank you!
-
6. Re: Dimension with multiple data types?
Tracy RodgersSep 19, 2012 12:18 PM (in response to Susan Baier)
Sure! Right click on the desired dimension and select Create Calculated field.
Then, depending on which data type the dimension is and what is wants to be changed to. The following link provides further information on different type conversion functions:
Name the calculated field appropriately and voila! you should have the same field, but with different data types.
Let me know if this still does not make sense!
-Tracy
-
7. Re: Dimension with multiple data types?
Susan Baier Sep 19, 2012 12:34 PM (in response to Tracy Rodgers)Hi Tracy,
I did the type conversion, which looks like this:
STR([RESPONSE])
...and the dimension type shows as "=ABC".
But it still counts any text content as "NULL", so when I count the number of records I will show counts for items 1-7 (my numeric responses) but everything else is counted as "NULL".
Any ideas? Thanks so much, if I can get this to work it will save me a TON of time. :-)
-
8. Re: Dimension with multiple data types?
Susan Baier Sep 19, 2012 4:11 PM (in response to Shawn Wallwork)Hi Shawn,
I will definitely take you up on that. I ended up doing as you suggested and changed my data source so that even the string responses are a number, and then changed the aliases in Tableau. But it's pretty time consuming and if there's an easier way it would be a big help.
By the way, do you know of a way to autofill aliases based on a table or something? Going in an editing the alias names one by one takes FOREVER!
Thanks!
-
9. Re: Dimension with multiple data types?
Abdullah Alahdal Feb 10, 2014 9:45 AM (in response to Susan Baier)Any sufficient solution for this.
-
10. Re: Dimension with multiple data types?
Matt LuttonFeb 10, 2014 9:53 AM (in response to Abdullah Alahdal)
I would suggest creating a new thread of your own, along with a detailed write-up of your particular scenario, a packaged workbook that exemplifies your data structure (use sample data or randomize yours if needed), as well as a mock-up/description of what you want as an end result.
If you post a packaged workbook example, I'll be happy to take a look at your problem.