Forum Discussion
Merging queries with partial common column
- Jun 04, 2020
Table.Group is generated automatically as here
After that in formula bar (or in Advanced Editor) you shall for each column remove this part
and replace each _ with formulas above
If you mean transform left part of the screenshot to right one as
you may query the range, replace empty values on null (I had space when copy/pasted, replace what you actually have), group by first column adding aggregation for each next column with All rows; in formula bar replace group aggregation by removing nulls and returning first value. Entire script
let
Source = Excel.CurrentWorkbook(){[Name="Range"]}[Content],
#"Replaced Value" = Table.ReplaceValue(
Source," ",null,
Replacer.ReplaceValue,{"Column2", "Column3", "Column4", "Column5"}
),
#"Grouped Rows" = Table.Group(
#"Replaced Value",
{"Column1"},
{
{"Column2", each List.First(_[Column2])},
{"Column3", each List.First( List.RemoveNulls( _[Column3]))},
{"Column4", each List.First( List.RemoveNulls( _[Column4]))},
{"Column5", each List.First( List.RemoveNulls( _[Column5]))}
}
)
in
#"Grouped Rows"
So there is no user friendly way to do the last step? I dont understand how to do that "Table.group(" step other than to replace values in your formula
- SergeiBaklanJun 04, 2020Diamond Contributor
Table.Group is generated automatically as here
After that in formula bar (or in Advanced Editor) you shall for each column remove this part
and replace each _ with formulas above
- Ocasio27Jun 04, 2020Iron Contributor
Expression.Error: The name '_' wasn't recognized. Make sure it's spelled correctly
IDK why im getting this
- SergeiBaklanJun 05, 2020Diamond Contributor
Hard to say without seeing the code. That could be each missed in front of formula with _