PQ question - "splitting" x2 rows into 2 columns and then removing 2nd row

scott_86_

New Member
Joined
Sep 27, 2018
Messages
45
Office Version
  1. 365
Platform
  1. Windows
Hi,

Please see mini-sheet below. Could anyone please be able to assist in some applied steps (or M code) I can use to further transform the green table to the orange table?


Power Query:
// M-Code from Table 1 to Table1_1 in the below mini-sheet

let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"User ID", Int64.Type}, {"Identifier", type text}, {"Version", Int64.Type}, {"Current status", type text}}),
    #"Filled Down" = Table.FillDown(#"Changed Type",{"Name", "User ID", "Version", "Current status"})
in
    #"Filled Down"

000. Admin.xlsx
ABCDEFG
1INITIAL REPORT EXAMPLEBlue Table Name = Table1
2NameUser IDIdentifierVersionCurrent status
3Test, Name9999Admin-Test (Department)88Test status
4Apprentice Mechanical (Position)
5
6
7REPORT AFTER PQ FILL DOWN COLUMN A, B, D & EGreen Table Name = Table1_1
8NameUser IDIdentifierVersionCurrent status
9Test, Name9999Admin-Test (Department)88Test status
10Test, Name9999Apprentice Mechanical (Position)88Test status
11
12
13FURTHER RESULT REQUIRED FOR Table1_1 (as below)
14- Create new column "Identifer2"
15- Populate "Identifier2" with value in "Identifer" Row 2 (purple value)
16- Remove Row 2
17- Repeat for 'x' amount of names in actual report
18
19NameUser IDIdentifierIdentifier2VersionCurrent status
20Test, Name9999Admin-Test (Department)Apprentice Mechanical (Position)88Test status
21
22
PQ Ques
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    lst = List.Split(Table.ToList(Source, each _), 2), 
    tbl = Table.FromList(List.Transform(lst, (x) => x{0} & {x{1}{2}}), each _, Table.ColumnNames(Source) & {"Identifier2"}), 
    reorder = Table.ReorderColumns(tbl, {"Identifier2", "Version", "Current status"})
in
    reorder
 
Upvote 0

Forum statistics

Threads
1,225,669
Messages
6,186,346
Members
453,349
Latest member
neam

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