Skip to content

Commit b676d12

Browse files
authored
Create Table.AutoExpandTableColumn.pq
1 parent b41894c commit b676d12

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
// Someone asked for a way to auto expand xml columns
3+
// hard coded example filter
4+
Table.AutoExpandTableColumn = (source as table, columnName as text ) =>
5+
let
6+
allNames = Table.ColumnNames( source ),
7+
filteredNames = List.Select( allNames, (item) =>
8+
not Text.StartsWith( item, "http://", Comparer.OrdinalIgnoreCase ) ),
9+
10+
prefixedNames = List.Transform( filteredNames, each expandColumnName & "." & _ ),
11+
return = Table.ExpandTableColumn( source, columnName, allNames, filteredNames )
12+
in
13+
return

0 commit comments

Comments
 (0)