Add fExtractAndRename function and create fIfBlank file
This commit is contained in:
16
power-query/fExtractAndRename.m
Normal file
16
power-query/fExtractAndRename.m
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
let
|
||||||
|
ExpandAndRename = (tTarget as table,
|
||||||
|
sDataColumnName as text,
|
||||||
|
sTagString as text) as table =>
|
||||||
|
|
||||||
|
let
|
||||||
|
tagString = sTagString,
|
||||||
|
tableSubstition = try Table.SelectRows(fP("RENAMING_RULES"), each ([#"#"] = tagString)) otherwise error "No substitutions provided",
|
||||||
|
extractedColumnNames = try Table.Column(tableSubstition, Table.ColumnNames(tableSubstition){0}) otherwise error "Bad column list",
|
||||||
|
newColumnNames = try Table.Column(tableSubstition, Table.ColumnNames(tableSubstition){1}) otherwise error "Bad column list",
|
||||||
|
|
||||||
|
ExpandData = Table.ExpandTableColumn(tTarget, sDataColumnName, extractedColumnNames, newColumnNames)
|
||||||
|
in
|
||||||
|
ExpandData
|
||||||
|
in
|
||||||
|
ExpandAndRename
|
||||||
0
power-query/fIfBlank
Normal file
0
power-query/fIfBlank
Normal file
Reference in New Issue
Block a user