Slashdot Mirror


A Complete Guide to Pivot Tables

r3lody (Raymond Lodato) writes "Like most people, I've only scratched the surface (well, maybe I gouged it a bit) of the capabilities of the Microsoft Office products. There are more features buried in them than most users ever discover. I use Microsoft Excel frequently in my job to analyze all sorts of data. When they came out with Pivot Tables, I dabbled in them and found several uses for them. However, documentation being what it is, I never really got to understand and utilize Pivot Tables' full capabilities. Now, Apress has published A Complete Guide to Pivot Tables: A Visual Approach, by Paul Cornell." Read on for the rest of Lodato's review. A Complete Guide to Pivot Tables: A Visual Approach author Paul Cornell pages 368 publisher Apress rating 10/10 reviewer Raymond Lodato (rlodato AT yahoo DOT com) ISBN 1590594320 summary A well-researched step-by-step tutorial on the use and programming of Microsoft Excel PivotTables for data analysis.

If you have any need to analyze data in Excel, you must read this book. I learned so much more about PivotTables after I read it that they are now actually useful, rather than just being something I would occasionally try out. Every chapter is packed with excellent information in an easy-to-follow format. A beginning to intermediate user can understand most of the book; only the chapter on programming PivotTables requires intermediate to advanced knowledge to fully comprehend.

Cornell takes a tutorial approach to explaining what PivotTables are, what they are capable of doing, and how you can apply them to your needs. Each chapter in the Complete Guide gives you an overview of a single topic, a series of step-by-step examples, a Try-It section for more practice, and a summary of next steps. The book was written for Excel 2003, but most of the techniques can be applied to Excel 2002 and even Excel 2000.

When you read this book, I would recommend that you sit at your computer to try these techniques as you read them. I tried to just read the book at first, but you really get itchy to try each feature out. Take it in sequence, as there is a definite building from one chapter to the next.

Chapter 1 gives you an overview of the PivotTable feature, what it's meant to do, and why you would use it. Chapter 2 starts the in-depth training of building basic PivotTables from Excel Lists, external data sources, other PivotTables, etc. It also includes tips on formatting the information and tweaking the fields and table to your liking. Chapter 3 goes even deeper, with information on advanced settings, filters, calculated fields, and other little gems that make analysis easier. These three chapters complete your basic training and lead to chapter 4, "Using PivotTables in the Real World." Paul proceeds to give not just one, but three examples of how PivotTables could be used to provide insight into company operations.

While everything I'd known about PivotTables before picking up this book was covered in the first three chapters, the last three chapters explain additional capabilities that really make Excel valuable for data analysis. Chapter 5 explains PivotCharts, which are simply a graphical representation of the information shown in a PivotTable. Paul goes into detail on the different chart types and how they interact with the underlying PivotTable.

If you need to distill and analyze multidimensional, relational data, PivotTables are up to the task, as chapter 6 will demonstrate. The book describes how you use cube files, OLAP databases, and Microsoft Query to get the data and manipulate it. If you're a really capable programmer, comfortable with VBA, chapter 7 shows you how to work with PivotTable programmatically. There is program after program showing you exactly how to get at the data, massage it, and create the resulting PivotTable.

Finally, there is one appendix that describes the differences between Excel 2000, Excel 2002, and Excel 2003. I was originally reviewing this book while using a computer with Excel 2000. I was delighted to find out that most of the information in the book works exactly as Paul described (although the screen shots didn't match). I did recheck some of the examples on my other machine running Excel 2002, and had no problems at all.

Granted, this book is specifically written for Microsoft Excel. However, OpenOffice, the free competitor from Sun MicroSystems, mimics most of the Microsoft Office suite. How does it compare, you ask? Well, OpenOffice has a similar facility to PivotTables, called DataPilot; however, DataPilot is primitive in comparison. For example, you must select the data to summarize, choose (from the menu bar) Data --> DataPilot --> Start, then drag the fields to the appropriate place in the diagram and click OK. Like Excel, you can freely move the fields between row, column, and data areas, and change the data operation from Sum to Min, Max, or a number of others. Unlike Excel, there isn't much more you can do. You don't have Page fields; you can't sort fields on their data; PivotCharts aren't represented; and there's no programming. If you only want to do simple data analysis in OpenOffice, you can get the basics from chapters 1 and 2 of this book.

You can purchase A Complete Guide to PivotTables: A Visual Approach from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

49 of 261 comments (clear)

  1. What IS a pivot table anyway? by Hanzie · · Score: 4, Insightful

    I'd really like to know what the hell a pivot table is. From reading the review at Amazon and the one here a 'pivot table' is:

    'something really useful for analyzing data, and really great'

    Sorry, sahib, but if you want me to read (let alone purchase) a book about pivot tables, I'm going to need some explanation of what they are first.

    I don't pretend that I'm speaking for any number of people here. Perhaps every slashdotter besides me knows what a pivot table is, but the description of the review would seem to imply otherwise.

    Could anybody else describe a pivot table?
    ***********
    Heh, heh. Google's first hit for "pivot table tutorial" is already slashdotted.

    --
    ********* sig: If you don't like the law, get filthy stinking rich, and buy a better one.
    1. Re:What IS a pivot table anyway? by FrereTuck · · Score: 5, Informative

      Read this: http://www.cpearson.com/excel/pivots.htm

    2. Re:What IS a pivot table anyway? by KernelHappy · · Score: 3, Funny

      Think of it like a movie, if the article told us what a pivot table was, we wouldn't need to buy the book, then book sales would plummet and then the publishing industry would start building anti-concept copying mechanisms into text. I think it's all for the best it remains a mystery.

      --
      -- Button up, your ignorance is showing
    3. Re:What IS a pivot table anyway? by Chundra · · Score: 4, Funny

      I'm going to put MCPTE (Microsoft Certified Pivot Table Engineer) on my resume. Wheee!

    4. Re:What IS a pivot table anyway? by roman_mir · · Score: 5, Funny

      Pivot table means that; it's pivotal. I mean, you're a -- you've been given pivotality, and you're viewed as a pivotal entity. And therefore the relationship between the data and tables is one between pivotal entities."

    5. Re:What IS a pivot table anyway? by slamb · · Score: 2, Informative
      I'd really like to know what the hell a pivot table is.

      First, you've got to have some data to describe. Here's one I'm looking at right now: I've got a table in my Oracle database that lists services doctors performed on given dates, and how much they charged for them.

      A conventional report would describe that data one-dimensionally. Total amount of money each doctor charged or total amount of money charged in each date range.

      A pivot table (or matrix report, as Oracle Reports calls them) shows the same data two-dimensionally. Down the left is a list of doctors. Across the top is a list of months. Cells in the middle show how much each doctor billed in a given month. There are monthly totals at the bottom, doctor totals on the right, and a grand total in the lower right.

      So essentially, a pivot table is just a tool for putting data from a RDBMS into the spreadsheet form you know and love.

    6. Re:What IS a pivot table anyway? by RandomWhiteMan · · Score: 3, Informative

      A pivot table can be used to combine data in a similar set together. Say you have a lot of data points in a spreadsheet, say inventory levels for socks by the purchase order they come in on. You have the number of socks, it's PO number, it's color, and the date the shipment is received.

      You can use a pivot table turn this data points (all data for that point is contained on a row, with the top row giving the header for each column quantity, color, PO, date,) into a table. This way you can have a table for the total number sock delivered each week by color. Or just the number of shipments of socks of a particular color in a month.

      Might not sound really useful, but if you get a lot of data on a day to day basis out of some SQL query and need to reorganize it into a more readable format (or make some nice charts for the PHB,) it is a life saver. I've also found other quick uses for when you need all your data in a certain format and either lack the skill or time to program a custom SQL query to get the data out in the right format. Pivot Tables, Text-to-Columns, and the CONCATENATE function in excel have been life savers for me before on projects once I get to the number crunching point.

    7. Re:What IS a pivot table anyway? by Sai+Babu · · Score: 2

      So there's a whole book dedicted to a friggin format change? Awk handles this with ease.

    8. Re:What IS a pivot table anyway? by Ohreally_factor · · Score: 2, Interesting

      But I think one could expect to be given a clue if the review of The Washington Manual Hematology and Oncology Subspecialty Consult to explain it, especially if that review appeared in a general purpose tech site.

      Besides which, hematology and oncology are not obscure terms, and it is quite easy to find a definition. Pivot Tables, otoh, are a specialized phrase to a specific program (or programs, I guess, given the mentions of the Lotus product above), and even the review itself points out that this is a "buried feature".

      Saying, "If you have to ask, you don't need to know," in this situation is a bit rude.

      --
      It's not offtopic, dumbass. It's orthogonal.
    9. Re:What IS a pivot table anyway? by squidfood · · Score: 2, Informative
      'push these buttons and out pops a report in this format is NOT an explanation'.

      Okay, the format isn't magical, it's just a table. The magic-ish is the interface for changing it, basically, you can drag and drop ("pivot") your data categories (columns) and quickly say: okay, lets sum by widgets. Now by gadgets. Now by widgets that are gadgets.

      All this can be done on the SQL command line. But this is one place where drag and drop works better than the command line (and I'm a sworn CLI addict for most things).

      The un-magic about Excel pivot tables is that your're limited to 64k rows of data. In using these from Oracle, much of the trick is writing the base query to get a result down to 64K lines, then pivoting the results.

    10. Re:What IS a pivot table anyway? by Sai+Babu · · Score: 2, Informative

      OK, I did a little research. A pivot table is a fancy name for a feature in Excel that adjusts the calculation squares in your spreadsheet as you change the presentation format. This allows you to look at the data in your spreadsheet in a bunch of different formats without having to rearrange all the calculation squares yourself. I can see some aura of elegance there for the RDB and AWK impaired. You guessed it, I don't use excel.

    11. Re:What IS a pivot table anyway? by bob+beta · · Score: 3, Insightful

      Some might argue (I wouldn't, but some would) that the "RDB and AWK impaired" are the people who know too much about those tools, and not enough about anything else.

      I'm just sayin'. . .

    12. Re:What IS a pivot table anyway? by jacobcaz · · Score: 2, Informative
      Please enlighten me. I understand relational databases. 'push these buttons and out pops a report in this format is NOT an explanation'.

      Okay - I'll take a stab at this. I've been using pivot tables rather heavily since being introduced to them in the last 12 months or so. The step up from a pivot table is a full-blown business intelligence (BI) tool.

      Pivot tables allow you to "slice-n-dice" your data. Say you have a set of data that contains the following items: Business unit, sales person, sales territory, customer, customer buying group, order number, item information, cost and revenue. It's all just row after row of data, got it so far?

      With SQL or just a big honkin' Excel sheet you can easily calculate data in one dimension (i.e. select/calculate all orders by salesperson X).

      It's much more difficult to work in more than on dimension with data in this format. This is where pivot tables are really handy. Say you have the above data, but need to quickly produce a report to show revenue, by customer group, by item, by salesperson, sorted by date. That's more tricky.

      This is a bit simplified; with a pivot table you simple select your data "elements" customer group, item and salesperson on the left, your date element on the top and then drop your "revenue" data element (subtract COGS from revenue) in the middle of the pivot and all the fields are automagically calculated. The best part is this all happens from your big, honkin' list of data. You didn't need to figure out any tricky SQL joins, etc when you got the data. You let the pivot table do the work.

      Where it gets nice is the "slice-n-dice" capability I mentioned. Say you present this fancy report to your boss who says, "Great! Now show me the same by customer and not customer buying group!" All you have to do is replace the "customer group" element with the "customer" element and all the data is recalculated as fast as you can drop the fields. You didn't have to go back and touch your source data at all, it takes literally seconds to change how you represent the data.

      There are a lot of OLAP (online analytical processing) tools out there. We use Cognos' Powerplay tool. It's nothing but a pivot table on steriods. It works on cubes (collections of data) which we produce from our ERP system. Then we can look at and present our data in the OLAP tool extremely easily. We even have executives using this tool (albeit at a less productive level than the hardcore BI geeks).

      If you've ever seen someone whiz around with a pivot table or a BI tool you'll understand why I'm rather excited by all of this. It's powerful stuff and makes looking at data, trends in data and "drilling down" into data painless and rather fun. To see it for youself, whip up some bogus data in Excel and run the pivot table wizard (data - PivotTable and PivotChart Report...). It will walk you through your first pivot table in about 2 minutes!

    13. Re:What IS a pivot table anyway? by LinuxHam · · Score: 2, Informative

      So essentially, a pivot table is just a tool for putting data from a RDBMS into the spreadsheet form you know and love.

      And allows you to choose any subset of the fields of the spreadsheet for display in a mini-spreadsheet, lets you choose any field you want to serve as a "grouping agent" and dynamically updates subtotals for you. Plus, the subtotals and totals field can be changed to a variety of formulae, including Sums, Averages, even just counts. And you can choose whether or not to show every record that contributed to that subtotal, or just the subtotal line, and make that choice for *each* group.

      So, to continue your example, you could check to see what the average price was for a particular service, or count the number of times a particular procedure was performed during a particular month, or each month, whatever. You can twist and mold your data and get views into trends and summaries like never before. Well, perhaps you could get at it in the past, but not with this level of ease and thoroughness.

      And whoever suggested using awk against a csv to achieve this is so far off-base, its laughable.

      --
      Intelligent Life on Earth
  2. The first rule of PivotTables... by Aardpig · · Score: 5, Funny

    ...is you do not tell anybody what PivotTables are.

    --
    Tubal-Cain smokes the white owl.
  3. Multi-dimensional databases by gtrubetskoy · · Score: 4, Interesting

    For those who do not understand what multi-dimensional database is, here is how I explain it to myself:

    A traditional relational database has two dimensions - rows and columns. Now if you take a table and make a copy of it to separate records by year (e.g. 2004data, 2003data, 2002data, etc.), you get a 3rd dimension. And if you were to take your entire database and make a copy of it to separate it by something else, you now have a 4th dimension. Of course the problem with all this would be inability to tie data in one database to data in another in an easy way.

    A multi-dimensional database is something that allows you to add dimensions ad-infinitum _and_ query it in a clean way.

    1. Re:Multi-dimensional databases by slamb · · Score: 2, Insightful
      A traditional relational database has two dimensions - rows and columns.

      I don't think that's a good way to look at it.

      A relation (a single SQL table, view, query) has rows and columns, yes. But the column headings are fixed. So it's only one-dimensional.

      However, this one-dimensional structure is adequate to represent N-dimensional data. (By having a table with a composite primary key of N columns.) It's pointless to "take a table and make a copy of it to separate records by year"; the relational way is to simply introduce a new column called "year". And you can have different tables to represent data of different arities. (One table to store stuff independent of year, one table to store stuff that is dependent on year and whatever else, one table to store stuff that is dependent only on year. However many tables it takes to properly normalize your data.)

      One dimensional may not be adequate to understand N-dimensional data, though. If you make a query, you get a one-dimensional list. If you want to view a two-dimensional matrix, you need to use a matrix report/pivot table. This can make things much easier to look at and get a feel for.

  4. Whats the most power feature in Excel? by stecoop · · Score: 2, Interesting

    I rank Pivot Tables about #1 in usefullness. Followed by autofilter, Vlookup, conditional Formating and regular old little VBS scripts. What are some of the higher features you guys use?

    1. Re:Whats the most power feature in Excel? by Rude+Turnip · · Score: 2, Insightful

      I'm an "INDIRECT" junkie, myself. One of my jobs is to maintain a weekly snapshot of the universe of closed end funds (all 678 of them this week). Each week's worth of data (pulled in from a Bloomberg feed using the BLP function) is kept in a flat table in Excel with all the fields one would typically examine.

      Each table of data is named for the week, ie "11-12-2004". The INDIRECT function lets a user type in the date he/she needs to look at and the model will pull in the data from the appropriate tab.

      Or, using a combination of INDIRECT and MATCH, I can take two tables of data from two different sources and merge them together, as long as both tables have one column of roughly similar data (ie a list of names or serial numbers).

    2. Re:Whats the most power feature in Excel? by RandomWhiteMan · · Score: 2, Insightful

      Text to columns works really great, especially when you have a field for the date, but need it by month, or year. Concatenate I also use a lot, mostly in conjunction with text to columns. I pretty much just use excel to get large blocks of data formated, and then copy and past into Mini-Tab to run it through statistics formulas.

    3. Re:Whats the most power feature in Excel? by T3kno · · Score: 3, Funny

      I like the export to xml feature so that I can xslt out all of the cruft and insert the data where it belongs, in PostgreSQL.

      --
      (B) + (D) + (B) + (D) = (K) + (&)
  5. What's a pivot table by Pedrito · · Score: 4, Insightful

    I'm on the edge of my seat. Why would I want to read a book about Pivot Tables? It could be the best book every written in the history of Pivot Tables, but it may as well be a book on Gorglemopenchausers. I mean, I realize it's a book review, but even a sentence or a short paragraph saying, "A pivot table is basically XYZ" would have added a great deal of value to me as a reader.

  6. And then ! by ilikeitraw · · Score: 2, Funny

    Pivot tables are priceless. I worked in a company with about 100 client service people, and they had no idea how they worked.
    I would have to query the data out of oracle for them, and pivot the data for them, so they could send the report to the client.

    Then, they would get HUGE commissions checks for pushing the "send" button in Outlook, and I would get nothing.

    Then.... I quit.

  7. Re:OK, so what is it? by hj43us · · Score: 5, Informative

    Pivot tables allow you to cross count units withing categories. Imagine you hava a table of stock, you have shoes. Shoes have size number and model id. A pivot table can easily tell you the number of shoes of each size of each model. Of course you can get the same values out of simple SQL query (i.e. select count(*),model,size from shoes group by model,size) The difference is the pivot table will look like a double entry table instead of the long listing the query above might provide. I'm not sure I know enoguh to full a book about this. Cheers.

  8. Pivot Table History by bstarrfield · · Score: 5, Informative

    Pivot tables were originally developed in Lotus Improv, Lotus's incredibly advanced word processor for the NeXT machine. Lotus attempted to develop a new paradigm (can't believe I used that word) for spreadsheet interaction, something more sophisticated that +A1+@sum(B1..B3). Pivot tables were a component of this formulaless spreadsheet.

    Improv was, is friggin' amazing.

    I suppose this is another example of Microsoft getting credit for company's innovations?

    --
    /* Dang, I can't type that well. */
    1. Re:Pivot Table History by ackthpt · · Score: 2, Insightful
      Pivot tables were originally developed in Lotus Improv

      Well, that pretty much cements it, Microsoft is probably fondling a patent on these at this very moment, waiting to spring forth and attack some open source project, only to have prior art slapped in their faces.

      --

      A feeling of having made the same mistake before: Deja Foobar
    2. Re:Pivot Table History by Tim+C · · Score: 2, Insightful

      I suppose this is another example of Microsoft getting credit for company's innovations?

      No, it's a review of a book about a feature of Excel. I see nothing that states or implies that MS invented them, other than a note that the equivalent functionality in OpenOffice isn't as advanced or comprehensive.

      True, it says that OO "mimics" many of the features of Office, but it's a fair point - it's often described as a (potential) Office killer...

    3. Re:Pivot Table History by geg81 · · Score: 2, Informative

      I suppose this is another example of Microsoft getting credit for company's innovations [apple.com]?

      I'm getting tired of just about every discussion about Microsoft being used as an opportunity by Apple fans to promote their favorite company. Keep that sort of stuff to the Apple groups, please. Whether or not Microsoft copied a feature from Lotus Improv has nothing to do with Apple.

      Furthermore, it is stupid for Apple fans to point fingers when it comes to copying: without copying other companies' innovations, Apple wouldn't exist; they copied the very core of their platform from others (SRI, PARC, Alan Kay). Apple does have better taste than Microsoft in what they copy, but I hardly think they are more original.

  9. Summary of what a Pivot Table is by Wrexen · · Score: 5, Informative

    Say you have data like this:

    Name Age Height (cm)
    ---------------------
    Jane 22 174
    Dick 22 212
    Mary 24 150
    Greg 24 198
    Dave 23 244

    You can use pivot tables to come up with tables like this (but with correctly calculated values :)):

    Age Avg Height
    --------------
    22 190.5
    23 244
    24 174.5

    For the most simple case, take any N-dimensional data, choose one of the dimensions to be your rows, choose one of the dimensions to be your columns, and choose a function of a dimension to be your field values. The more dimensions and data points you have, the more useful this becomes.

    1. Re:Summary of what a Pivot Table is by UnknowingFool · · Score: 3, Insightful

      Here's another example where one of the dimensions is not a number

      Region Product Sales
      West Skirt $150
      East Pants $160
      West Pants $80
      East Skirt $90

      Pivot:

      Region Skirt Pants
      West $150 $80
      East $90 $160

      For those who don't deal with pivot tables, they are used primarily to organize data so that relationships between the dimensions can be analyzed. In the example above, you can see that sales for pants and skirts are higher in one region than the other. While you can see this relationship right away in the raw data, it beomes harder when you have much more data. Pivot provide a way to slice data

      --
      Well, there's spam egg sausage and spam, that's not got much spam in it.
  10. Re:Dissing OpenOffice by 0racle · · Score: 4, Interesting

    Many, many people live and die by pivot tables, well people that use Excel to any extent do, it is only obscure to people that use Excel as if it was a pad of paper. As such, any spreadsheet product that did not have a similar feature that was at least as usefull and powerfull would indeed be primative, and pretty much useless to anyone using Excel professionally. Don't let zealotry dictate what tools you use.

    --
    "I use a Mac because I'm just better than you are."
  11. Pivot table was the foosball table by FerretFrottage · · Score: 2, Funny

    where I last worked. Sure everyone one knew what you meant when you said "let's take a look at the data in a pivot table", but at least it sounded better then "let's foos". Plus you could claim to be the PTC (pivot table champion) and not know a damn thing about Excel.

    --
    "Look Lois, the two symbols of the Republican Party: an elephant, and a fat white guy who is threatened by change."
  12. Re:Dissing OpenOffice by Pedrito · · Score: 2, Funny

    Many, many people live and die by pivot tables,

    And I would suspect many more die trying to figure out what they are.

  13. Excel Feature? by Geste · · Score: 2, Informative

    Whaaaa? 38 pivot-table posts on /. and nobody has mentioned Lotus Improv yet? Fixed.

  14. A simple example of pivot tables by sjbe · · Score: 5, Informative
    The best way to understand pivot tables is probably by example. Lets say we have a spreadsheet with four categories of data: Country, Continent, GDP, and Population. These are listed in columns, with corresponding entries next to each other like so (apologies for bad formatting):
    Country Continent GDP Pop
    China Asia $1000 1,000,000,000
    Japan Asia $5000 100,000,000
    USA North Am $15000 280,000,000
    Then lets say we are interested in finding the population of countries on our list which a located in asia. Pivot table provide a fast way to sort data as well as conduct simple mathematical operations on lists of data.

    Using a pivot table I could end up with a matrix that looks like:
    Continent Country Population
    Asia China 1,000,000,000
    Japan 100,000,000
    North Am USA 280,000,000
    Now I have the data sorted by continent. If I decide I'm not interested in population but instead in GDP, it is a simple drag and drop operation to get a table like:
    Continent Country GDP
    Asia China $1000
    Japan $5000
    North Am USA $15000
    Basically pivot tables let you explore lists of data very quickly and efficiently. If you deal with lists of data regularly like I do, they are one of the most indespensible features in a spreadsheet. Excel has the best ones I've used but most modern spreadsheets have some version of them.
    1. Re:A simple example of pivot tables by aoteoroa · · Score: 2, Interesting

      Thanks sjbe.

      So you can use a pivot table to quickly sort and group data. When does it make sense to use a pivot table instead of a simple sql query such as:

      SELECT sum(Pop) FROM Country GROUP BY Continent ;
      or
      SELECT sum(GDP) FROM country GROUP BY Continent ;

    2. Re:A simple example of pivot tables by sphealey · · Score: 2, Informative
      That seems somewhat arrogant. I work on the business side of a startup and I don't have time to run SQL queries on my data in order to get at actionable information. Pivot tables are very useful - if for no other reason than I use Excel for data analysis and not a SQL database.
      That is funny, because when I seen Finance struggling with pivot tables I can usually take their data, upload it into Oracle, query out the answer they need, and give them the results back for formatting in about 1/4 the time it would take them to calculate the answer in Excel.

      Excel is a great tool for certain tasks. Since it is the only data manipulation tool many people know, it gets used for things it really shouldn't.

      sPh

    3. Re:A simple example of pivot tables by TomV · · Score: 2, Informative

      Now you've hit the nail - it doesn't make sense in that precise situation. When it *does* make sense is when the person to whom you give this data then immediately says "that's great. Now could we see how that breaks down by Age?", so you go off and rewrite the query to GROUP BY Age mod 10, say, and go back and show the results, to be met with "Thanks. That's really useful. It would be even better if we could split it into male and female."

      So, back to the SQL prompt, GROUP BY sexMF ORDER BY sexMF, back to the end-user, to the inevitable "Thanks, that's just perfect. But... how do the ages and sexes total up across all the countries in Sales Region 3?".

      The bonus, for our company anyway, of the Pivot table is that we can write a single query to bring back lots of raw data without any of the GROUP BY clauses in place, and then the Account Managers or Operations Supervisors or whoever can use the Pivot Table feature to choose their own GROUPings and subtotals, counts, averages, sort orders and so forth, in their own time, generating dozens of business-useful reports from a single half-hour chunk of chargeable IT time. And since IT time is recharged at about ten times the price for Account Management time, the Pivot Table approach saves us a lot of time and a lot of expensive IT time to use on more profitable work.

  15. Ughhh... by Darth_Burrito · · Score: 3, Insightful

    Just sort of a general comment ... I think the capability of office suites to do complicated things is directly proportional to the amount of pain felt by regular IT staff. Seriously, it's nice that people can do all sorts of neat stuff and track data outside of the system... because, often due to time constraints, it's not always possible for IT staff to facilitate all requests... but then they come ask us for an on-demand parameterized report that works off an ms sql server database, mysql, access, and excel.... and we get stuck doing it regardless of the relative value proposition and it takes a lot of time and ends up crashing when someone locks the excel file or fubar's the access database... and it's our fault.

    Part of what makes it so painful is you get stuck spending your time trying to figure out how to do something the-right-way in excel when the same task would be trivial in a database. It's not just a matter of burning everything to the ground because, if you take that approach, you are forced into accepting responsibility for rewriting the thing. Some of the stuff I've seen people make is just so thoroughly messed up as to be conceptually, not just technically, beyond redemption.

    Of course, the flip side is, if people can do more stuff on their own, that's one less thing they have to bug me about... but the things they do hit you with become all the more painful.

    deep hurting...
    sandstorm....

  16. PIvot tables? Yawn by pclminion · · Score: 3, Informative
    From what I can tell, these "pivot tables" are just a primitive form of concept analysis (data mining).

    Anybody reading this article who actually thinks these pivot tables sound "powerful" should look into some of the real row-based data mining tools out there. For starters I suggest looking at Weka and Orange.

    Weka in particular is extremely easy to use and you don't have to be a researcher to figure it out.

  17. Description of a Pivot Table by chrisatslashdot · · Score: 2, Informative
    Suppose a database of widget info...cost, model, storage location, color, etc.

    A pivot table:
    • A rectangular table with rows and columns
    • Along the top you some pick attribute(s) of the widget
    • Along the left side you pick other attribute(s) of the widget
    • You pick what goes into the interior of the table and how it is summurized
    So you could compare color(along top) with location(along left side) and choose to see the sum of the inventory levels in the interior.

    or...

    SELECT color,
    location,
    SUM(inventory)
    FROM table
    GROUP BY color, location


    But in matrix form so that you end you with one cell for each color+location instead of one record. So the size of the matrix grows approximately by a power of 0.5 with respect to the number of results.
    Database output:
    location |color | inventory
    warehouse A| red | 100
    warehouse A| blue | 123
    warehouse B| red | 0
    warehouse B| blue | 50

    Pivot Table
    ------------red blue
    warehouse A 100 123
    warehouse B 0 50
    --


    Simple people talk of people, better people talk of events, great people talk of ideas.
  18. When viewing the page with Firefox . . . by acceleriter · · Score: 2, Insightful
    . . . it says at the top
    Warning: You are viewing this page with an unsupported Web browser. This Web site works best with Microsoft Internet Explorer 5.01 or later or Netscape Navigator 6.0 or later.

    Would you like some FUD with those tips?

    --

    CEE5210S The signal SIGHUP was received.

  19. Pivot table info and resource by kendor · · Score: 4, Informative

    There seems to be some natural and/or knee-jerk confusion that pivot tables are some Microsoft-only creation. For some folks that naturally means that they'll never want to use them. That's too bad, a little bit like concluding that referential integrity or relational table structures are "so Microsoft" just because they're discussed in SQL Server documentation and literature.

    Best discussion I've read of pivot tables as a generic tool for managing data appears in O'reilly's thin "Transact SQL Cookbook". Excellent book. The first few chapters are devoted to pivot tables alone. According to the authors, PTs are fundamental to solving many data storage and display problems. Have a read, then post more. :)

  20. Re:Pivot tables are basically SQL aggregates? by dogugotw · · Score: 4, Insightful

    I'm no M$ lover, but pivot tables beat the crap out of SQL. Why? Ease of use. To build a pivot table takes about, ohhh, 30 seconds if you're clueless. To then generate a graph, 1 second. Don't like the particular pivot/chart you have set up? No problem, grab the field you don't want, pull it out, drag a couple more in and you're done. They make it incredibly easy to visualize the data you're working with and take very little effort to set up or change. They also provide almost effort free data filtering and very simple but powerful drill down options. We use them to figure out failure trends on production data.

    I use OO and the data pilot just ain't there yet.

    If you've never used pivots (and have Excel) go play.

    Are they perfect? No. I'd love to see an option to use something besides bar charts - XY plots with regressions would be the one big thing I'd like to see.

    Dogu

  21. Quantrix does it better by rjrjr · · Score: 2, Informative
    If you like pivot tables, you'll love Quantrix. It's a multi-dimensional spreadsheet that picks up the ball that Lotus Improv dropped.

    Disclaimer: I'm not a shill--not even a customer, in fact. But I'm a friend of the author, and was a contributor to Quantrix's NeXTstep based predecessor.

  22. Re:Pivot tables are basically SQL aggregates? by grassy_knoll · · Score: 3, Insightful

    Anything Pivot tables do that isn't possible in SQL?

    I've created Excel pivot tables and pivot charts as front ends to OLAP cubes stored in a MS SQL Server[1].

    The main advantage is end-users can drag and drop predefined data elements to change the representation of data quickly. They can also choose which members of a data element to include / exclude.

    So sure, lots of this can be done with SQL where clauses and group by/order by clauses. However, its a LOT faster with a pivot table / pivot chart.

    As other posters have mentioned, this is one case where the GUI beats CLI.[2]

    [1] All those Microsoft products... Karma, we hardly knew ya.

    [2] This from a guy who's favorite IDE is still VIM.

  23. SysAdmins, please play dumb about Pivot Tables... by ManyLostPackets · · Score: 2, Funny

    I don't don't know about anyone else, but I was foolish enough to show seasoned analysts the minor miricle of pivot tables.

    Guess who the new data analyst is?
    (along with the e-mail guy, the PBX guy, script monkey, tech support dude, etc...

    Grokk-me-not

  24. Much easier than the old way by Animats · · Score: 2, Funny
    Back in the old days, we had to run all the cards through the sorter to sort on the desired field. Then we'd wire a IBM 407 tabulator board to do a control break on the desired field, and print the total. If someone wanted an average, we had to cable up the 519 summary punch to the 407, and wire a tabulator board to send the total and count to the punch. The 407 couldn't divide, so then we'd run the summary cards through the 602A multiplier to do the divide. The 602A would do A=B/C and punch A into the same card that contained B and C. Then the summary cards could be resorted into the desired report order and run through the 407 with yet another board to generate the report.

    You guys have it easy.

  25. Amen, brother! by vogon+jeltz · · Score: 2, Insightful

    Unfortunately my mod points expired yesterday ...

    Gnuplot, Python, awk, bash, and sometimes even C make your day when analyzing megabytes of data.

    I ususally find it more convenient to come up with some hacked-up solution rather than to study Excel or OOo documentation only to realize later that Excel doesn't like the raw ASCII format my data is saved in.