![]() You’ll only have values in the column for the row where the metric matches. Once you’ve created calculated fields for each metric, your data will look something like this: The idea is to capture the value for that row, if the metric matches the new column. The first step is to create a field for each metric (okay, it might be a little tedious if you have 50 metrics – but it’s mostly cut and paste). We’ve already considered some of the issues we’d face if we took this directly to Tableau. We have multiple rows for each star ship – one for each metric we’re tracking. We’ll start with the original table from above: But, here is a way that is simpler, less complicated, and easier to implement.) In fact, after some thought, I wouldn’t ever do it that way. If you have more than a few columns, you wouldn’t want to do it that way. (And then, of course, there’s the initial way I came up with in response to a question here, that is a bit more tedious. But until then, there is a way to accomplish it that is fairly painless. ![]() Tableau Prep (Maestro) was just released and is an amazing tool, even in version 1! I truly hope to see an unpivot feature soon that allows everything to be done with a few mouse clicks and drag-and-drop. Aggregations and calculations will also be quite a bit easier with the second table. In the second table, I can assign a different format to each field. For example, if you only have the Value field, then what format do you give it? In some cases above, it’s a percent while in others it’s a whole number. ![]() But if you truly have different measures, then having an individual field or column for each one will make your life a lot easier. Now, in many cases, having the taller, narrower data is actually better – if it’s all the same measure. Then, I want to take the list of metrics and have a column for each, like this: What do I mean by “unpivot”? The term is actually used in different ways in different software packages, but here I mean taking rows of data and translating or transposing them to columns. Given the right tools, Scotty could solve just about anything! Unpivot Data – Rows to Columns
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |