3 Replies Latest reply on Dec 28, 2018 9:38 AM by Norbert Maijoor

    How to combine multiple measures without Measure Names/Values or Pivoting

    Nicole Izbicky

      I cannot attach a workbook for security reasons, so hopefully I can explain my question well enough.

       

      My Data: I am working with crime data. I have an existing dimension in the data called Primary, which groups things by type of crime (e.g., Battery, Robbery, Homicide). I would like to identify Shootings, which I can do via calculated field. The calculated field for Shooting uses two existing columns in the data (Primary & Method). I am flexible on how to calculate Shootings -- IF/THEN, CASE, 0/1 -- I have done it multiple ways while trying to figure this out on my own. The end goal with the data is to have each row (with a unique incident identifier) be coded as it already is in Primary and be coded as a Shooting or not.

       

      The Goal/Question: The goal is to create a viz where Shooting is included in the same column as the categories in Primary without any kind of subdivision. For example:

       

      Battery - 10

      Robbery - 12

      Homicide - 3

      Shooting - 7

       

      I do realize that some incidents will be double counted (an incident could be a homicide and a shooting) -- that is OK. I WANT them to be double counted.

       

      The Caveats/Problems: I have done a fair amount of research on overlapping group members and this type of issue on the Community already, and here are the problems I am facing with my current use case. I created 0/1 coded Dimensions for each Primary category and Shootings so that I could create a viz like I referenced above using Measure Names & Measure Values. While this worked, it limits me on what I can do with these categories moving forward. For example, I would like to create a viz where I have the Primary categories + Shootings on Rows and then other Measures I created on Columns and it is creating problems . I have also created the Shooting field as a discrete Dimension so that I could Pivot it with the Primary field, BUT you cannot Pivot a calculated field without Tableau Prep, which I do not have.

       

      If anyone can assist me, it would be appreciated! I am happy to provide as much information about my dataset as I can.