Reshaping is a choice, based on the goal of the view you are creating in Tableau. If you want individual columns for each measure, it may make sense to use the horizontal format, particularly since the "values" are not in a consistent format (one is a decimal number, the others are dollar amounts).
We can typically get what you want with a vertical format as well--however, again, since the Margin is a percentage value, this format may not be ideal for this particular data set--but again, it depends on your goal.
But, if you want separate measures for each, it may make more sense to use your original horizontal format.
Thank you for the response- and yes, I've been using the horizontal format
and it seems to be working fine.
Is there a way to identify the individual "categories" (sales, profit,
margin) to measures using the vertical format?
On Thu, Jun 12, 2014 at 8:39 AM, Matthew Lutton <
Yes, you could write out calculations, but what you'll end up with is basically the same as your Horizontal Format--except you'll have additional calculations to get at those columns.
You could write calcs like:
SUM(IF [Category]=="sales" then [value] end) // Sales calc
SUM(IF [Category]=="profit" then [value] end) // Profit calc
But again, that is basically re-re-shaping your data into a Horizontal Format (you are adding columns when you create these calculated fields)--so, I don't see any reason to use the Vertical Format if the Horizontal Format is working well for you. Performance is sometimes a concern, but if you are using an extract, that shouldn't be much of an issue.
One piece of data in each row isn't always your best option. Are you quoting a document? I'm not sure I am familiar with it, so please include a link if possible. Actually, there is some ambiguity in what a piece of data is. It is generally simplest to work with a dataset where each row contains information about a single unit, where a unit might be a customer, order or date for example.
The reshaper has some advanced settings that can help you retain more than one measure per row (I don't have it handy at the moment, but I think maybe it is another tab). As I understand the reshaping tool, it is basically a way to un-pivot data that has been presented in tabular form (such as dates going across the top). Based on the sample above it is my guess that reshaping wouldn't be necessary on this data, but without knowing exactly how it will be used it is hard to say.
Too slow this morning. That is what I get for trying to answer questions on my iPad.
Yes, Noah, in this document, it is recommended: http://kb.tableausoftware.com/articles/knowledgebase/preparing-excel-files-analysis
Note the BIG BOLD WORDS: Make sure each row contains only one piece of data
This is a big pet peeve of mine (misleading documentation, or easily misunderstood documentation I suppose). I have had a love/hate relationship with this KB article, because it uses Test Scores as an example--and I've often asked for this type of data in a columnar format, because it made sense for the goal(s) of the view(s) I was working on. But my DBA saw the article, and thought "Tableau says use a Vertical Format, so that must be the hard and fast rule". The documentation makes it seem, particularly to a newcomer, like we must use a vertical format.
One piece of data in each row isn't always your best option.
I particularly like this comment, but also your comment as a whole.
Thanks to everyone for their answers- this does seem a bit misleading to
only use one piece of data per row. I was using the horizontal orientation
without any obvious problems, but I thought I may be missing something.
On Thu, Jun 12, 2014 at 8:54 AM, kettan <
That documentation is pretty rough (thanks for the link Matthew). It would be nice to see that expanded/clarified. Cash, the good news is that your instincts are right on target. If it aint broke, don't break it.
How can you find how many unique widgets are there? Also I want to know how many unique widgets are there with respect to area?
will this work in vertical format? I think it will work in horizontal format, not sure though.
Area Product Category Value
A Widget A Sales $500
A Widget A Profit $100
A Widget A Margin 20%
B Widget B Sales $500
B Widget B Profit $100
B Widget B Margin 20%
D Widget C Sales $500
D Widget C Profit $100
D Widget C Margin 20%