Maxim on 06 Jul 2020 19:34:56
I often have to merge one step of a query with another step from the same query. It would be usefull if I could select existing steps of current query from interface.
The situation comes up often when, for example, you have a general mapping that needs to be filtered before applied. Or merging two tables that need to be groupped before merge. I don't want to create separate query just for filtering \ merge, so I do it inside the main query. Example:
let
Source1 = Table1
GroupedforMerge = Table.Group(Source1 , {"SettleDate", "NonResID", "SubAccCode", "SECID", "SecISIN", "SecName", "SecAssetClass","SettlCur"}, {{"SettleAmount", each List.Sum([SettleAmount]), type number}}),
Source2 = Table2,
//2nd table
FilteredCode141C = Table.SelectRows(Source2, each ([КодДоходаКод] = "14")),
#"Merged Queries" = Table.NestedJoin(FilteredCode141C, {"КонтрагентКод", "Валюта", "ДатаВыплатыДохода", "ДоговорСКлиентом", "КодЦБ"}, GroupedforMerge, {"NonResID","SettlCur","SettleDate","SubAccCode","SECID"}, "FilteredCode14QORT", JoinKind.FullOuter),
....
It would be nice to be able to select "GroupedforMerge" step from inrface and not manually write it in code.