I have a table I'm having some trouble with and was hoping someone had already solved this issue.
I receive a report, which sadly can't be changed, that has a list of customer IDs and the sales reps assigned to them as well as the reps role. The problem is there are duplicate customer IDs since some accounts have multiple reps.
ID1 Rep1 Role1
ID1 Rep2 Role2
ID2 Rep3 Role3
ID3 Rep3 Role3
etc....
I need to get the list rotated so the customer IDs are the rows, the roles are the columns, and the name of the rep is in the value portion.
No matter how I run it, I still get a separate row for each customer ID and it doesn't place the reps name in one row, but instead on each row in the proper column. For each column in my query I have a simple IIF statement. If the Role=xxx the place the name of the rep in the spot, if not place 'N/A'.
IDs Role1 Role2 Role3
ID1 Rep1 N/A N/A
ID1 N/A Rep2 N/A
ID2 N/A N/A Rep3
ID3 N/A N/A Rep3
What I'm looking for is:
IDs Role1 Role2 Role3
ID1 Rep1 Rep2 N/A
ID2 N/A Rep2 N/A
ID3 N/A N/A N/A
I can't figure out how to get those rows combined.
Any ideas?
I receive a report, which sadly can't be changed, that has a list of customer IDs and the sales reps assigned to them as well as the reps role. The problem is there are duplicate customer IDs since some accounts have multiple reps.
ID1 Rep1 Role1
ID1 Rep2 Role2
ID2 Rep3 Role3
ID3 Rep3 Role3
etc....
I need to get the list rotated so the customer IDs are the rows, the roles are the columns, and the name of the rep is in the value portion.
No matter how I run it, I still get a separate row for each customer ID and it doesn't place the reps name in one row, but instead on each row in the proper column. For each column in my query I have a simple IIF statement. If the Role=xxx the place the name of the rep in the spot, if not place 'N/A'.
IDs Role1 Role2 Role3
ID1 Rep1 N/A N/A
ID1 N/A Rep2 N/A
ID2 N/A N/A Rep3
ID3 N/A N/A Rep3
What I'm looking for is:
IDs Role1 Role2 Role3
ID1 Rep1 Rep2 N/A
ID2 N/A Rep2 N/A
ID3 N/A N/A N/A
I can't figure out how to get those rows combined.
Any ideas?