Locked lesson.
About this lesson
In this lesson, you'll learn how to convert measures to dimensions and dimensions to measures.
Exercise files
Download this lesson’s related exercise files.
10 - Convert Measure to Dimension.docx57.1 KB 10 - Convert Measure to Dimension SOLUTION.docx
57.6 KB
Quick reference
Converting Measures to Dimensions
In this lesson, you'll learn how to convert measures to dimensions and dimensions to measures.
When to use
Use this whenever you need to convert a measure to a dimension or a dimension to a measure.
Instructions
In the sidebar of the WorkSheet screen, hover over the measure or dimension you want to change. Click the caret and select "Convert To Dimension" to convert to a dimension or select "Convert to Measure" to convert to a measure.
Hints & tips
- Dimensions can easily be converted to Measures
- Measures can easily be converted to Dimensions
- 00:04 In this video I want to talk about converting measures to dimensions and
- 00:08 vice versa.
- 00:09 So we've got over here are dimensions which are basically textual things,
- 00:13 category names and column names, things like that.
- 00:17 And down here we have measures which are generally numeric values,
- 00:20 numbers and things.
- 00:21 And you'll notice we've got an owner zip code down here,
- 00:24 which if you think about it, is numeric, zip codes tend to be numbers, but
- 00:28 they're not really mathematical.
- 00:30 You're not living at 27 plus 48 equals something, zip code.
- 00:35 Zip code is really a name really.
- 00:37 So maybe this shouldn't be a measure.
- 00:39 So how could we convert it to a dimension?
- 00:42 So I'm going to come over here and let's duplicate this, let's make a copy.
- 00:45 So clicking on the little caret and let's click duplicate and
- 00:48 you can see owners zip, we've got a copy right here.
- 00:51 And one interesting thing if we head over to our data source,
- 00:54 we'll see we've got an owner's zip copy.
- 00:57 We've still got the owners zip right here.
- 00:59 We've also got a copy.
- 01:00 So this has actually changed our data in our data screen here, so
- 01:04 just sort of keep that in mind.
- 01:06 It's not that important, but kind of interesting.
- 01:08 So now we've got this copy of our owners zip code.
- 01:10 How do we convert this into a dimension?
- 01:12 Well, super easy.
- 01:13 We just click on the little caret, come down here and convert to dimension.
- 01:17 And when we do, boom, it pops right up here into our dimensions,
- 01:20 we can see it's now blue.
- 01:22 It still has the little number sign next to it.
- 01:24 Tableau is sort of like: I think these are numbers,
- 01:28 it's not quite fooled, but at least now this is a dimension.
- 01:33 And now we can use this as we would any other dimension and that's cool.
- 01:36 So what happens if we've got something up here for instance,
- 01:40 this owner zip that we want to convert back to a measure?
- 01:43 Same thing, we just click on this, come down here and convert to measure, boom,
- 01:46 it pops it right back down.
- 01:48 No big deal.
- 01:49 So, Tableau makes it really easy to sort of switch around between measures and
- 01:52 dimensions.
- 01:53 Like I said, Tableau makes its best guess whenever you import data,
- 01:57 and it sees this zip code field and it says to itself, okay, these are numbers.
- 02:02 This must be a measure.
- 02:04 But we know that it's not really a measure because we're not counting zip codes
- 02:09 numerically they're descriptive.
- 02:11 We live at a certain zip code.
- 02:13 We might as well call that a name.
- 02:15 It's not a number.
- 02:16 So we like that.
- 02:17 And there are many, many other instances where you may have something as a measure
- 02:21 that you want to put as a dimension for any number of reasons and
- 02:24 that's a super quick and easy way to do it.
- 02:27 And again, remember, whenever we make a copy or make a change like that,
- 02:30 it will reflect in the data source over here.
- 02:32 So I can come back over here to my sheet, and I can grab this owners of copy and
- 02:36 I can click on a caret and
- 02:37 let's just get rid of this we don't really need it anymore.
- 02:40 We don't actually need to convert this to a dimension in this video.
- 02:43 We're going to be playing with the zip codes later on and
- 02:45 we'll mess with it then.
- 02:46 But now we can just get rid of it and go back to our regular owners zip.
- 02:49 And you'll notice in our data source over here,
- 02:52 that other column that copy is now gone again.
- 02:54 And we've only just got the regular zip code measure listed.
- 02:58 So pretty cool and pretty easy.
- 02:59 So that's pretty much all I have for the sort of introductory videos explaining
- 03:03 the look in the field and the layout of Tableau.
- 03:05 In the next video, we're going to jump in and start creating visualizations.
- 03:09 About to get a lot more interesting and that'll be coming up in the next video.
Lesson notes are only available for subscribers.