2 Replies Latest reply on Jan 30, 2017 12:29 AM by Mike Sohns

    Issue regarding pie charts based on measure values

    Mike Sohns

      I'm trying to create pie charts based on machine-data, to show how much total time each machinestatus (per machine) took over a given amount of time. So for example, if a machine had status 1 on 13:00:00 for 10 minutes, status 2 on 13:10:00 for 5 minutes, and status 1 again on 13:15:00 for 15 minutes, i would like to know how much total time the machine had status 1 and 2 (25 minutes for status 1 and 5 minutes for status 2). However, i can't seem to work out how to be able to 'group' or summarize a machinestatus to show the total amount of time per status per machine.

      This is the Dashboard. (Also attached) Sheet 1 shows a timeline of each machine and what status it had (together with when it started, ended and how long it took). On the next sheet i've managed to create the pie charts based on what is shown in sheet 1. However, each 'status' (together with the time) has its own slice in the pie, instead of it being grouped together (which means the pie chart for a machine has many slices). I would like to be able to show a single slice per status. The size of the slice has to be based on the total amount of time of each status per machine. Feel free to ask any questions!

        • 1. Re: Issue regarding pie charts based on measure values
          David Li

          Hi Mike, I don't know if there's a way to get what you want while preventing each record from having its own slice, but you can make it look like all the records for a given status are in the same piece of pie:

          To do this, just change the [Status] pill to be treated as Dimensions instead of treating them as attributes. Right-click the pill in the marks card to do that.


          The reason you probably won't be able to get rid of the individual slices is that your time difference is a table calc that requires the records to be in the level of detail. However, if you could edit this data source so that each record has a start and end time marked, you could avoid this.

          • 2. Re: Issue regarding pie charts based on measure values
            Mike Sohns

            Hi David Li,


            Thanks for your reply! I tried your method of grouping the records. however, like you said it still distincts each record as a slice, and the size of the slice is based on the amount of records, not the amount of hours. I did try something else to at least get the information i want. I made a new calculation with an IF statement:


            IF [Status]='ms:4' then 'Status 1'

            ELSEIF [Status]='ms:3' then 'Status 2'

            ELSEIF [Status]='ms:2' then 'Status 3'

            ELSEIF [Status]='ms:9999' then 'Status 4'



            What this does, it basically groups the records together. If this calculation is added to the dashboard, it shows me the amount of hours + together with the summary the percentage. One thing to add is that it has to be ignored in table calculations, because it needs the timeline of the first sheet. If it is not ignored, it will generate a timeline only based on the records in the same group, which means it will show incorrect times.

            Screenshot tableau.png


            The summary shows what i want (amount of hours + percentage of total). Next step will be how to properly visualize this.