Forum Discussion
garycarters
7 years agoHelper I
Splitting multi-element data structure list into separate rows
Hi all I have a table that contains a number of control records. Each control record can dictate the behaviour of an aspect of our system and may be a string, flag, file name or a list of data. ...
- 7 years ago
Hi garycarters
1. Create new Source >> Blank Query
2. Go to Advanced Editor and paste the Function Code Provided.
3. In your table, go to Add Column ribbon and find Invoke Custom Function
4. In the Function Query section select the function you have created (most probably Query1 if you have not change the name ).
5. In Your Column Section change ABC to Column Name and Select ListData from the drop down list next press OK to confirm.
6. Now you should have an extra column in your table that can be expanded by:
- Clicking inside the cell on "Table"
- If you want to expand on the original table, click on the double arrow on the column header and select the columns you want to add
Mariusz
7 years agoCommunity Champion
Hi garycarters
You can use the below M syntax
let
Source = {"1","Description 1", "1","Description 1", "2","Description 2", "3","Description 3"},
Split = List.Split( Source, 2 ),
Output = #table( type table [ ID = Int64.Type, Description = text ], Split )
in
OutputRegards,
Mariusz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.