What is the quick way to transfer data from row to column

Sian1

Board Regular
Joined
Nov 9, 2009
Messages
90
Request ID101102104105116134135143147148149
R-042A04GC700000149
R-023A0DAB800000149
R-042A059Q100000143149
R-042A059Q100000
R-042A059Q100000
R-005A0HFX800001102105149
R-042A059Y400000104134149
R-042A059Y400000149
R-023A0BE0200000149
R-001A0Y3T700000134135
R-001A0Y3T700000116143147149
R-023A0BE0200000101
 
So, just this then?

Book1 (version 2).xlsb
AB
1Request IDCode
2R-042A04GC700000149
3R-023A0DAB800000149
4R-042A059Q100000143
5R-042A059Q100000149
6R-005A0HFX800001102
7R-005A0HFX800001105
8R-005A0HFX800001149
9R-042A059Y400000104
10R-042A059Y400000134
11R-042A059Y400000149
12R-042A059Y400000149
13R-023A0BE0200000149
14R-001A0Y3T700000134
15R-001A0Y3T700000135
16R-001A0Y3T700000116
17R-001A0Y3T700000143
18R-001A0Y3T700000147
19R-001A0Y3T700000149
20R-023A0BE0200000101
Sheet12


Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    unpivot = Table.UnpivotOtherColumns(Source, {"Request ID"}, "Code", "Value"),
    selectColumns = Table.SelectColumns(unpivot,{"Request ID", "Code"}),
    Type = Table.TransformColumnTypes(selectColumns,{{"Request ID", type text}, {"Code", Int64.Type}})
in
    Type
that is it. let me try. thanks a bunch :)
 
Upvote 0

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
So, just this then?

Book1 (version 2).xlsb
AB
1Request IDCode
2R-042A04GC700000149
3R-023A0DAB800000149
4R-042A059Q100000143
5R-042A059Q100000149
6R-005A0HFX800001102
7R-005A0HFX800001105
8R-005A0HFX800001149
9R-042A059Y400000104
10R-042A059Y400000134
11R-042A059Y400000149
12R-042A059Y400000149
13R-023A0BE0200000149
14R-001A0Y3T700000134
15R-001A0Y3T700000135
16R-001A0Y3T700000116
17R-001A0Y3T700000143
18R-001A0Y3T700000147
19R-001A0Y3T700000149
20R-023A0BE0200000101
Sheet12


Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    unpivot = Table.UnpivotOtherColumns(Source, {"Request ID"}, "Code", "Value"),
    selectColumns = Table.SelectColumns(unpivot,{"Request ID", "Code"}),
    Type = Table.TransformColumnTypes(selectColumns,{{"Request ID", type text}, {"Code", Int64.Type}})
in
    Type
one more question is this Query code?
 
Upvote 0
It is but Power Query/Get and Transform is relatively easy to use and is suited for the task.
What version of Excel are you using? btw you can add these details to your profile.
 
Upvote 0
Select your table
On the Data Tab click From Table/Range
Click Advanced Editor then delete any code there.
Copy/Paste the code lrobbo314 posted and click done
Click Close and Load dropdown then click Close and Load to
Choose where you want the data and click OK.
 
Upvote 0
So, just this then?

Book1 (version 2).xlsb
AB
1Request IDCode
2R-042A04GC700000149
3R-023A0DAB800000149
4R-042A059Q100000143
5R-042A059Q100000149
6R-005A0HFX800001102
7R-005A0HFX800001105
8R-005A0HFX800001149
9R-042A059Y400000104
10R-042A059Y400000134
11R-042A059Y400000149
12R-042A059Y400000149
13R-023A0BE0200000149
14R-001A0Y3T700000134
15R-001A0Y3T700000135
16R-001A0Y3T700000116
17R-001A0Y3T700000143
18R-001A0Y3T700000147
19R-001A0Y3T700000149
20R-023A0BE0200000101
Sheet12


Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    unpivot = Table.UnpivotOtherColumns(Source, {"Request ID"}, "Code", "Value"),
    selectColumns = Table.SelectColumns(unpivot,{"Request ID", "Code"}),
    Type = Table.TransformColumnTypes(selectColumns,{{"Request ID", type text}, {"Code", Int64.Type}})
in
    Type
yea it works :)

now, different request :) as this is not one time thing, how could i automate it :P
 
Upvote 0
You don't need to automate it, you just refresh it.
 
Upvote 0
You don't need to automate it, you just refresh it.
thanks :)

While i have you here, i am having the problem now. I thought the results come in correctly but it just repeat all the code for all request ID. it should only return one value the sample result
like this

Request IDCode
R-042A04GC700000149


instead it returns with all code from the header, did i do something wrong?
sample results:
Request IDCode
R-042A04GC700000101
R-042A04GC700000102
R-042A04GC700000104
R-042A04GC700000105
R-042A04GC700000116
R-042A04GC700000134
R-042A04GC700000135
R-042A04GC700000143
R-042A04GC700000147
R-042A04GC700000148
R-042A04GC700000149
R-023A0DAB800000101
R-023A0DAB800000102
R-023A0DAB800000104
R-023A0DAB800000105
R-023A0DAB800000116
R-023A0DAB800000134
R-023A0DAB800000135
R-023A0DAB800000143
R-023A0DAB800000147
R-023A0DAB800000148
R-023A0DAB800000149


Sample:

Request ID101102104105116134135143147148149
R-042A04GC700000149
R-023A0DAB800000149
R-042A059Q100000143149
R-042A059Q100000
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,701
Members
448,980
Latest member
CarlosWin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top