mock.xlsx | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | |||
1 | id | first_name | last_name | gender | ip_address | |||||
2 | 1 | Gareth | Rickson | grickson0@gmpg.org | Male | 165.19.36.4 | ||||
3 | 2 | Dorthy | Akid | dakid1@blinklist.com | Female | 216.10.168.110 | ||||
4 | 3 | Bab | Sigars | bsigars2@dedecms.com | Female | 21.242.126.6 | ||||
5 | 4 | Junia | Bierling | jbierling3@economist.com | Female | 104.148.156.116 | ||||
6 | 5 | Dareen | Bote | dbote4@google.de | Female | 36.133.6.150 | ||||
7 | 6 | Tate | Strongitharm | tstrongitharm5@shareasale.com | Female | 207.140.225.38 | ||||
8 | 7 | Milli | Poveleye | mpoveleye6@symantec.com | Female | 29.141.203.178 | ||||
9 | 8 | Case | Duckworth | cduckworth7@boston.com | Genderfluid | 126.251.7.73 | ||||
10 | 9 | Francklyn | Vearncombe | fvearncombe8@cyberchimps.com | Male | 189.226.22.85 | ||||
11 | 10 | Zondra | Vidgeon | zvidgeon9@bloglines.com | Female | 23.43.9.118 | ||||
12 | ||||||||||
13 | id | first_name | last_name | gender | ip_address | first_name - Copy | last_name - Copy | |||
14 | 1 | Gareth | Rickson | grickson0@gmpg.org | Male | 165.19.36.4 | Gareth | Rickson | ||
15 | 2 | Dorthy | Akid | dakid1@blinklist.com | Female | 216.10.168.110 | Dorthy | Akid | ||
16 | 3 | Bab | Sigars | bsigars2@dedecms.com | Female | 21.242.126.6 | Bab | Sigars | ||
17 | 4 | Junia | Bierling | jbierling3@economist.com | Female | 104.148.156.116 | Junia | Bierling | ||
18 | 5 | Dareen | Bote | dbote4@google.de | Female | 36.133.6.150 | Dareen | Bote | ||
19 | 6 | Tate | Strongitharm | tstrongitharm5@shareasale.com | Female | 207.140.225.38 | Tate | Strongitharm | ||
20 | 7 | Milli | Poveleye | mpoveleye6@symantec.com | Female | 29.141.203.178 | Milli | Poveleye | ||
21 | 8 | Case | Duckworth | cduckworth7@boston.com | Genderfluid | 126.251.7.73 | Case | Duckworth | ||
22 | 9 | Francklyn | Vearncombe | fvearncombe8@cyberchimps.com | Male | 189.226.22.85 | Francklyn | Vearncombe | ||
23 | 10 | Zondra | Vidgeon | zvidgeon9@bloglines.com | Female | 23.43.9.118 | Zondra | Vidgeon | ||
data |
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"id", Int64.Type}, {"first_name", type text}, {"last_name", type text}, {"email", type text}, {"gender", type text}}),
table_duplicated = List.Accumulate({"first_name", "last_name"}, #"Changed Type", (state as table, current as text) =>
Table.DuplicateColumn(state, current, current & " - Copy")
)
in
table_duplicated
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"id", Int64.Type}, {"first_name", type text}, {"last_name", type text}, {"email", type text}, {"gender", type text}}),
DC = Table.AddColumn(#"Changed Type", "duplicated", each [NewFirst = [first_name],NewLast = [last_name]]),
ER=Table.ExpandRecordColumn(DC, "duplicated", {"NewFirst", "NewLast"}, {"NewFirst", "NewLast"})
in
ER