7 Replies Latest reply on Jul 15, 2018 7:59 PM by Ari Rose

    Standardize color coding for the same value coming from different fields

    Ari Rose

      Hi, I have a dataset containing two fields which are having the same set of possible values : (1) Departing Station and (2) Arrival Station.  Both fields contain standard airport IATA  codes. I have created two worksheets which i will be showing in one dashboard :

      First, a worksheet showing the number of flights departing from each airport, and the Second one shows the number of flights arriving at each airport.  I have created both as maps and color coded each airport station.  However, since the information exists in two separate fields, a different color is assigned to the same airport code.  For example, BKK airport code appears as green in the first worksheet; but appears as red in the second worksheet even though I use the same color palette.  is there a way for me to assign the same color to the same airport code without having to manually assign it as it is quite tedious given the number of possible values for airport codes?

       

      Hope my question makes sense, sorry it's my first time posting and I'm a tableau beginner.  Thanks in advance for any input

        • 1. Re: Standardize color coding for the same value coming from different fields
          Zhouyi Zhang

          Hi, Ari

           

          Can you provide a sample workbook?

           

          ZZ

          • 2. Re: Standardize color coding for the same value coming from different fields
            Peter Fakan

            Hi Ari,

             

            Drag your arrival station into the departure station viz, right click on it and deselect 'show header' so that its not visible.

             

            Then you can use the same station (departure or arrival because you can do this the other way too) as the colour code in both vizzes.

             

            HTH

             

            Peter

            • 3. Re: Standardize color coding for the same value coming from different fields
              Ari Rose

              Hi! Let me get back to you on this one.  I need to create some dummy data as the one I'm working on is having some sensitive information.  Will attach the workbook as soon as I get one.  Thanks to everyone for being so helpful really appreciate it

              • 4. Re: Standardize color coding for the same value coming from different fields
                Ari Rose

                Hi Peter,

                 

                Thanks for providing your input on my issue.  I'm not so sure if this would resolve my problem, though.  Each record in the dataset will be having an arrival station and departing station.  Both stations will have different values (for example, Arrival station = 'LAX'; Departing Station = 'NRT'.  There won't be cases where Arrival Station = Departing Station).  I'm still trying to make a dummy data and prepare a worksheet to help illustrate my issue.  Will attach it once it's done.  For the meantime, let me just provide more details on the problem I have:

                 

                 

                (A) My data may have values like this:

                     Record #1 : Arrival Station = LAX; Departing Station = NRT

                     Record #2 : Arrival Station = NRT; Departing Station = LAX

                 

                (B)  In my first worksheet, I would like to show a graph showing some measure (e.g. no of passengers) per Arrival Station in a month.  When I color Code my arrival stations, the following colors are assigned:

                     Arrival Station LAX : RED

                     Arrival Station NRT : BLUE

                 

                (C) In my second worksheet, I would like to show a graph showing the same measure as (B) (i.e. no of passengers), but this time, I use the Departing Station.  When I color code my departing stations, the colors assigned are different, though the values are the same as those found in (B):

                     Departing Station LAX : GREEN

                     Departing Station NRT : YELLOW

                 

                What I would like to happen is that in Worksheet (C), although the Departing Station is the field I use in my viz, I would like the following colors to be assigned to my Departing Station, which is consistent with the colors in Worksheet (B) :

                     Departing Station LAX : RED

                     Departing Station NRT : BLUE

                 

                I'll try to upload a sample workbook as soon as I can.  Again, many thanks for taking the time to help me out here Cheers.

                • 5. Re: Standardize color coding for the same value coming from different fields
                  Ari Rose

                  Hi Zhouyi Zhang and Peter Fakan,

                   

                  Attached is a workbook showing the issue. If you open the Dashboard, I have combined the Arrival and Departure worksheets.  You would notice that there are 4 common airport codes there :

                  1. HKG
                  2. NRT
                  3. SFO
                  4. LAX

                  But the colors assigned in the Arrival view and Departure view differ.  For example, HKG has been assigned the color Red in the Arrival view; but it is having a Pink color in the Departure view.

                   

                  Looking forward to any idea you may have. The only option I can think of (although I haven't tried it out yet, so I'm not sure if this feasible) is to create a union between the departure station and the arrival station and do some data blending with the main data source to be used for the color coding.

                   

                  Many thanks in advance to both of you and to anyone who can give some ideas or suggestions. 

                  • 6. Re: Standardize color coding for the same value coming from different fields
                    Zhouyi Zhang

                    Hi, Ari

                     

                    thanks for the workbook.

                     

                    I think you are in the right direction by using union, below is my workaround using the union and calculation field

                     

                    The result seems good, but when you have more than 20 stations, the color will be duplicated as shown below

                     

                     

                    I attached the workbook for your reference.

                     

                    Hope this helps

                     

                    ZZ

                    1 of 1 people found this helpful
                    • 7. Re: Standardize color coding for the same value coming from different fields
                      Ari Rose

                      Hi ZZ,

                       

                      This definitely helped me.  Thanks so much for your help!

                       

                      Regards,

                      Ari