3 Replies Latest reply on Nov 21, 2018 4:29 AM by luisa.bez

    Set actions and parameters to switch between colours


      I've created a dashboard depicting the London tube map with regular colours for each line vs whether the station is in a tunnel or not. You can switch between both views with a parameter.



      My idea was to use set actions, so when you hover over a line in normal view, it shows the tunnel view for that line only. It should also work the other way around: when you're in tunnel view and hover over a line, it would show you the normal colour for that line, eg red for the central line.


      What I want:


      I managed to create a set action highlighter for each line with a different colour but when I include the tunnel view colour (black and grey) in the calculation, it breaks the map. Is it possible to achieve what I'm looking for? If so, does anyone have an idea how to solve my problem?


      What I have...

        • 1. Re: Set actions and parameters to switch between colours
          Peter Fakan

          Hi Luisa,


          If you look at the points that are marked, they are only the open air elements from the line - thus the problem is with the tunnel data in the equation (or at least that you can't get it in) because this then affects the pathing. This is going to be difficult unless your reshape your data as Tableau will need separate path information for line drawing - i.e. on the Northern Line, it needs to know to stop drawing the line at Hampstead (the end of the open air line), and start drawing a line at Golders Green (the start of the tunnel line) The overlap space is the line between these two points - you can't really have a gap in the line.


          I took a different approach - instead of colouring the line, why not colour the stations on the dual axis ?



          HTH 18.3 attached



          • 2. Re: Set actions and parameters to switch between colours

            Hi Peter, thanks for your help! Does that mean I'd have to start a new line, indicated by a new shape ID, every time the tube line goes from tunnel to open air and vice versa? As long as the gaps are really small, you wouldn't see them in a zoomed out map.


            I'd really like to keep the information for all tunnels, not just the stations so don't mind reshaping the data.


            Edit 1: I also noticed that if I take [Colour] off the marks shelf for "Map normal" (which doesn't contain sets and work perfectly fine) and add it back again, it breaks the map in tunnel view. Why is that? Can you replicate that error? As long as I've got that error, I can't even start building set actions because I don't understand what's wrong with my [Colour] field.


            Edit 2: I got it to work! I had to set my [Set Action Colour] Field to MIN.

            • 3. Re: Set actions and parameters to switch between colours

              I got it to work for the tunnel view. When I hover over a line, it changes to the actual colour. Now I'd like to set this up for the normal view so I can see the tunnels for a specific line.


              How do I set up my calculated field to consider the parameter? I tried


              IF [Tube View Parameter]="Tunnel" AND [Line Set] AND [Line]="Central" THEN "Red"

              ELSE [Open Air or Tunnel]



              but that will break my set action and not return any colour at all. Any ideas, please?


              Edit 1: Fixed it1

              1 of 1 people found this helpful