4 Replies Latest reply on Apr 26, 2018 8:38 AM by Heather Berg

    Running Sum Calculation by Zip Code/Year

    Heather Berg

      Hi all,

       

      I'm currently working on a project using Tableau Desktop Version 10.5.3 where I am mapping out voter turnout in the state of Delaware for school board elections. I have gotten majority of the way through the project; however, it seems that the calculation for "votes received" is populating incorrectly from my database.


      We are trying to hyper-localize votes by both zip code and polling location. I currently have my data calculating as a Running Sum, but the numbers I am getting in my visualization do not match with what is in my spreadsheet. For example, with no filters selected, the full map is screenshotted below. As you can see, "Total Votes Received" is listed with a maximum value of 5,426, which is, in fact the highest number of total votes received by any zip code over the 5-year window I'm analyzing.

       

      Screen Shot 2018-04-26 at 10.09.19 AM.png

       

      When broken out in the map, though, my year filters and school district filters seem to be miscalculating. For example, on my Excel sheet, "Appoquinimink School District" received 1,931 votes from zip code 19709 over the 5-year window. When I hover over the map (see below), it says 504. This is actually the number of votes received by Waters Middle (one out of four polling locations for that zip code).

       

      Screen Shot 2018-04-26 at 10.46.04 AM.png


      When you filter out district and year, the number should change to reflect the sum of votes received per zip code for ALL polling locations in that given year. I cannot figure out how to get this to correct itself and would greatly appreciate any help/insight. I am attaching both my datasheet and my tableau workfile for your reference.


      Thank you in advance for any guidance or support!