Forum Discussion
Syndicate_Admin
Administrator
3 years agoHow to combine worksheets
I have a set of data in three different worksheets. Show below is a sample of data in the first 12 rows of each worksheet
I will like to
(i) combine the 3 worksheets into a single table and
(ii) add a label to each column (or header to the table). For example, the 8 columns will have headers A,B, C, D, E, F, G, H
Worksheet 1
| 119 | 42 | 135 | 25 | 16 | 129 |
| 42 | 43 | 41 | 48 | 31 | 88 |
| 153 | 31 | 49 | 120 | 114 | 140 |
| 83 | 137 | 59 | 67 | 110 | 75 |
| 16 | 140 | 89 | 143 | 20 | 30 |
| 32 | 25 | 132 | 89 | 48 | 121 |
| 93 | 40 | 84 | 114 | 121 | 74 |
| 56 | 74 | 45 | 104 | 28 | 82 |
| 25 | 58 | 117 | 100 | 85 | 133 |
| 87 | 68 | 47 | 127 | 140 | 51 |
| 95 | 24 | 81 | 102 | 85 | 102 |
| 117 | 70 | 103 | 57 | 18 | 29 |
Worksheet 2
| 5 |
| 10 |
| 2 |
| 27 |
| 12 |
| 12 |
| 12 |
| 19 |
| 10 |
| 3 |
| 21 |
| 8 |
Wrksheeet 3
| 180 |
| 131 |
| 192 |
| 125 |
| 224 |
| 200 |
| 218 |
| 184 |
| 199 |
| 224 |
| 138 |
| 174 |
1 Reply
- AlienSx
Super User
Hi, Syndicate_Admin
let ws1 = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("RZC5EcQwDAN7UexA/PTU4nH/bRwB2roEw5HWS1j33UR2u5prhlhkKkIGQnd7rrsu3RCCWBmGaS3eS9h34pvfdaQ40juZZVwwMwPMmEQAzijLePH00sKNVFk5TE89jsTYRlRIbJakwv8VFM2mk4hRc2IUdYwKx1IC9Aelwo6dutpq9S84H0CchM7TPN4efEiol9Chx9FrTcknH6qjdVACKV79+QE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t, Column4 = _t, Column5 = _t, Column6 = _t]), ws2 = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlWK1YlWMjQAU0YQ0hwiZoSNskRWbwxRbwimLJRiYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]), ws3 = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrQwUIrVAdLGhhDa0ghCG5mCaSMjEwhtAFFnZGgBkbcwgaq3RFFnaAyVNwfyYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]), combined = Table.FromColumns( List.Combine( List.Transform( {ws1, ws2, ws3}, Table.ToColumns ) ), {"A".."H"} ) in combined