2 Replies Latest reply on Apr 27, 2012 8:57 AM by wjones

    Division in Calculation is wrong

      I'm having a hard time understanding why when a divide column A by column B I get the wrong result. I've tried other operations on the two columns and they work fine (addition, subtraction and multiplication). However when I do division the result is terribly off. Anyone experience an issue like this? Anything I should possibly check?

        • 1. Re: Division in Calculation is wrong
          Jonathan Drummey

          Hi,

           

          It's hard to say what's going on without seeing some sample data or a packaged workbook. I have two thoughts:

           

          1. By default, Tableau aggregates the measures that are in the view, so [Sales] becomes SUM([Sales]), etc. So you might have SUM([Sales]) and SUM([Profit]) in the view. However, if you set up a calculation of [Sales]/[Profit] that's going to be calculated on each row in the underlying data, whereas SUM([Sales])/SUM([Profit]) would be what you'd likely expect since that would be calculated based on the dimensions in the view. I set that up in the attached workbook.

           

          2. If you have numbers that are set to display as integers or as #K, #M, etc. and you have a division calculation that results in values smaller than 1, 1K, etc. then Tableau can end up rounding and displaying zeroes, so you'd have to appropriately adjust the number format for that measure.

           

          If neither of these ideas work, post a packaged workbook with some sample data and we'll figure it out.

           

          Jonathan

          • 2. Re: Division in Calculation is wrong

            Yes Johnathan, the solution was definitely point 1. Thanks!!