4 Replies Latest reply on Nov 8, 2018 1:05 PM by Brock Sibert

    Trying to split data in a column into multiple columns

    Brock Sibert

      Hi all,

       

      I'm sure this question has been asked before, but I for the life of me could not figure out how to word it correctly. In my dataset, there are multiple values that correspond to a single column for each item. Because they correspond to the same ticket, I am getting multiple rows, as expected. My question is, is it possible to split the rows in the column into multiple columns?

       

      So taking a look at the screenshot in Attachment1, item RITM0298557 has two approvals: a director approval and a system ID App Owner Approval. The data source has a separate row for each Dv Approver and has a corresponding Dv Wf Activity. Tableau then correctly sees that both approval items belong to the same number and displays them as such. However, I would like to have a director approval column, and if there's a director approval, have it display the appropriate Dv Approver name. The same would occur for the System ID App Owner Approval. I have tried using if statements such as If [Dv Wf Activity]="Director Approval" THEN [Dv Approver], which does pull in the correct name. However, if that item has multiple approvals it shows the name and null values for the other approval types (as seen on attachment 2). Ultimately, I would like to have a separate column for each type of approval and drag them all onto the rows shelf.

       

      Any insight is greatly appreciated! I would love to provide a sample workbook but the data is confidential.

        • 1. Re: Trying to split data in a column into multiple columns
          Jeevan Krishna

          Hi Brock,

           

          From what I understand, I think you already have your required solution.

           

          Move [Dv Wf Activity] field to columns shelf and [Dv Approver] to text filed on marks tab. You will see what you require.

           

          Is there anything else, I am missing out on? If so please elaborate on your necessary end result.

           

          Hope this helps

          • 2. Re: Trying to split data in a column into multiple columns
            Brock Sibert

            Hi Jeevan,

             

            Thank you, very, very much for your reply! I truly appreciate it. Your suggestion definitely works and displays the information I'm looking for so thank you for that. However, I am ultimately looking to do some conditional formatting with Tableau that compares the data in the [Dv Approver] dimension with other columns I will be pulling in.

             

            As you can see in the attached screenshot, I would like for Tableau to look at the value in the Application Owner Approval [Dv Wf Activity] column and compare it to that in the [Dv Owned By Column]. If the returned value is the same I will display a certain color and if it is not true a different color. By using the method you described above, I'm afraid I am unable to do that, which is why I was hoping to make each value within the Dv Wf Activity dimension it's own dimension. Hopefully this makes sense.

             

            Thank you again for your insight!

            • 3. Re: Trying to split data in a column into multiple columns
              Jeevan Krishna

              Hi Brock,

               

              Do you want different colors only to be shown as indicators or you also need to show text?

               

              If it is only as indicators, change your mark type from text to square or circle as you like and add [Dv Wf Activity] to color mark

               

               

              Or if you need your text to be colored,

               

               

              Hope this helps.

              • 4. Re: Trying to split data in a column into multiple columns
                Brock Sibert

                Hi Jeevan,

                 

                Thank you again for a quick reply. While the above method definitely works, I'm afraid it isn't quite what I'm looking for.  I would like to compare the Value of the Application Owner Approval to that in the Dv Owned By column and only make it a color if the values are the same. But I'm not sure if it's possible to compare a field from the Dv Wf Activity dimension to another dimension without making them their own dimension. Perhaps I'm just thinking about it incorrectly.