2 Replies Latest reply on May 14, 2018 7:14 AM by Daniel Caroli

    Rounding Errors and Small Multiple Headers

    Daniel Caroli


      This is my first post in the forums and I could really do with some help on rounding errors.

      In the attached workbook I'm showing a small multiple chart for 9 different categories using a single sheet.

      I want to be able to show a header for each of the charts and a single total for the most recent stacked bars.


      On Centre C you can see that the total is shown as 0.57%, yet the two stacked bars are 0.17% and 0.41%, so the total should be 0.58%.

      (I've turned on the bar labels to make comparisons easier, these are usually off).

      Something Interesting.png


      I'm assuming the error is coming from the dimension called [Label - Name & Date]   (here's the calculation I'm using)


      IF DATEDIFF('month',DATETRUNC('month',[Date]),{DATETRUNC('month',max([Date]))})=3



      [Centre]  // Puts the name at 4th date from the end

      ELSEIF DATEDIFF('month',DATETRUNC('month',[Date]),{DATETRUNC('month',max([Date]))})=0



      LEFT(STR(round(({fixed [Centre],[Date]    :   ([Numerator 1&2 %])}*100),4)),4)




      Because I'm using stacked bars and want to show the value and the centre name, I'm converting the value to a string and I'm guessing there's a rounding error creeping in here.

      Any help or a point in the right direction would be really useful!