Forum Discussion
Anonymous
5 years agoNot applicable
Spliting rows with spicific columns
Hello Everyone and thank you in advance for your help, I'm struggling with this problem, here's an example: I manage to split the rows using M but I can't find a way to make the split...
- 5 years ago
Hi Anonymous ,
- Check the column "Row" and unpivot other columns
- Check the resulting "Attribute"-column and extract the first 3 characters from it
- Pivot that new column with "Values" in the values-section
Anonymous
5 years agoNot applicable
let
Source = Table.FromRecords(Json.Document(Binary.Decompress(Binary.FromText("lZC9CsJAEAbf5atT3F9ArlNjTEyh0RxyiG8QtBIL8d3V4/aygoXXzS4sM+zpgf31DisLHDonYTFfLBEGBXu5jWNgzdgwLon7wb+PdQDFlpqxYRwPn0X0K+avkh9VHWP+DJAlFagsvU76/ria9IN3WXojSC+FyAowKcC7dgrYbdsUgE2zBhWga2r8/ICihFkqiGQ+WV/28ws=", BinaryEncoding.Base64),Compression.Deflate))),
cols=Table.ColumnNames(Source),
rows=Table.RowCount(Source),
ncols=(Table.ColumnCount(Source)-1)/2,
lstrecs=List.Transform({0..rows-1}, (r)=> List.Transform({1..ncols}, each [Row=r+1,SKU=Table.Column(Source, cols{_}){r},QTY=Table.Column(Source, cols{ncols+_}){r}])),
recs=List.Combine(lstrecs),
tfr=Table.FromRecords(recs),
#"Filtrate righe" = Table.SelectRows(tfr, each ([QTY] <> null))
in
#"Filtrate righe"