Forum Discussion

WFetherolf's avatar
WFetherolf
Copper Contributor
Apr 28, 2022

Converting row based data to column based

I'm sure there's a different way to name this, and I'm sure I'm making this more difficult that it needs to be.  I have data in the following format:

 

TestScriptNameA, passedTestPoints, FailedTestPoints, ExecutionDate

TestScriptNameA, passedTestPoints, FailedTestPoints, ExecutionDate

TestScriptNameA, passedTestPoints, FailedTestPoints, ExecutionDate

TestScriptNameA, passedTestPoints, FailedTestPoints, ExecutionDate

TestScriptNameA, passedTestPoints, FailedTestPoints, ExecutionDate

TestScriptNameB, passedTestPoints, FailedTestPoints, ExecutionDate

TestScriptNameB, passedTestPoints, FailedTestPoints, ExecutionDate

....

....

...

 

You get the idea. I would like to turn this into the following:

 

TestScriptNameA, ExecutionDate1, passedTestPoints1, failedTestPoints1, ExecutionDate2, passedTestPoints2, failedTestPoints2, .....

TestScriptNameB, ExecutionDate1, passedTestPoints1, failedTestPoints1, ExecutionDate2, passedTestPoints2, failedTestPoints2, .....

 

and so on and do forth.

 

I tried with a PivotTable, and I'm sure I'm doing something wrong, but it's not working out the way I'd like.

 

Any help would be appreciated.

1 Reply

  • Azure_SQLDBA's avatar
    Azure_SQLDBA
    Copper Contributor
    Delimit them with comma (,) and copy the data than paste special with Transpose option. This should work

Resources