6 Replies Latest reply on Oct 13, 2015 2:13 PM by Shawn Wallwork

    Floor Map: how to show more than 1 person per room?

    Philipp S

      Hi!

      I have two tables:

       

      Employees:

        

      Employee NameTeamRoom
      Philipp S.SolutionsBE4_3
      Martin C.SolutionsBE4_3
      Boris S.SolutionsBE4_3
      Christiane F.Customer CareBE4_1

       

      and Rooms:

       

      Roomxy
      BE4_1182888
      BE4_2270888
      BE4_3355888
      BE4_4660888

       

      I've joined both tables and displayed the points in a map (floor plan of our building).

      For all rooms I would like to show all persons as labels. Is this possible?

      So far I could only visualize it when there's 1 person assigned to each room, see attached twbx.

       

      Thanks in advance!

        • 1. Re: Floor Map: how to show more than 1 person per room?
          Shawn Wallwork

          Phillipp, you can do this the easy way, or the hard way:

          • Easy way: Click Label shelf, click 'Allow Labels to Overlap'. Then manually move the labels off the top of each other. You'll get this:

          2015-10-09_11-09-00.png

           

          Given the small size of your room, jittering might not work that well since it might move them outside the room.

          1 of 1 people found this helpful
          • 2. Re: Floor Map: how to show more than 1 person per room?
            Philipp S

            Hello Shawn,

            Thank you for this valuable hint. I was hoping that there would be an easier solution, like combining the captions of all overlapping items. But I will look into this idea of jittering.

            Thanks, Philipp

            ---

            EDIT:

            Some more experimenting brought me exactly to this solution... By partitioning along the room ID I "concatinated" the labels of each record for the record with index=1. So this would be solution nr. 3 (neither easy nor hard ).

            • 3. Re: Floor Map: how to show more than 1 person per room?
              Shawn Wallwork

              Philipp, please post your solution workbook, I'd like to see what it looks like and how exactly you did it. This is a common ask on our forums, so having a solution that's easier than Jittering will be a great addition.

               

              Also mark your own answer as correct. Cheers.

              • 4. Re: Floor Map: how to show more than 1 person per room?
                Philipp S

                Sure.

                This is what I achieved by "concatinating" the labels of all data points which have the same position on the map:

                Untitled.png

                Attached you'll find the twbx.

                Cheers, Philipp

                 

                EDIT: I had to mark my own answer as the correct one to mark this thread as solved. Please don't blame me...

                • 5. Re: Floor Map: how to show more than 1 person per room?
                  Shawn Wallwork

                  EDIT: I had to mark my own answer as the correct one to mark this thread as solved. Please don't blame me...

                  Philipp, this is as it should be, no need to apologize. And thanks for the workbook!

                  • 6. Re: Floor Map: how to show more than 1 person per room?
                    Shawn Wallwork

                    Nicely done!

                     

                    IF FIRST()==0 THEN ATTR([Employee Name])

                    ELSE PREVIOUS_VALUE("") + "

                    " + ATTR([Employee Name])

                    END

                     

                    EDIT: For those playing along at home, I figured it might be helpful to unpack Philipp's calc:

                     

                    • FIRST()==0 ..... This says "If this is the first record then...." (FYI: You don't need the ==, one = will also work just fine.)
                    • ATTR([Employee Name]) .... Because he has invoked a table calc in the first line, everything will need to be aggregated in the rest of the calculation, so he's using the ATTR() aggregation, which works well as long as the value returned is singular, otherwise you'll get the dreaded *.


                    [Everything to this point takes care of the first row of data.]


                    • ELSE PREVIOUS_VALUE("")  .... this is the one I found illuminating! I'd never seen this construction before (and would have bet against it working at all!). But it does 'collect' all the string values from the row above, which is what we need to collect all the names together.
                    • This next bit is hard show, but easy to explain. The way to insert a carriage return (line feed) in a Tableau text box is to start with a quote mark on one line, enter the carriage return, then enclose it on the next line with another quote mark. (This is not obvious or intuitive, and took me a long time to learn.) This is definitely something handy to know.
                    • ATTR([Employee Name]) ...Finally he adds this, which is now the current row and is being concatenated to the previous row. This will cycles through until there are no more ATTR([Employee Name]) values for this point in the scatter plot.

                     

                    Like I said, great stuff! Something to add to your toolbox.