From 07892607331a684df3949b3a0b7b467e206d0f2f Mon Sep 17 00:00:00 2001 From: DaTekShaman Date: Wed, 29 Oct 2025 12:43:09 +0300 Subject: [PATCH] Small updates to fP --- power-query/fP.m | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/power-query/fP.m b/power-query/fP.m index 590e76e..ac40d96 100644 --- a/power-query/fP.m +++ b/power-query/fP.m @@ -4,7 +4,7 @@ let GET_PARAMETER = try let GetTable = Excel.CurrentWorkbook(){[Name="PARAMETERS_TABLE"]}[Content], - KeepNeeded = Table.SelectColumns(GetTable,{"ПАРАМЕТР", "ЗНАЧЕНИЕ","ТИП"}), + KeepNeeded = Table.SelectColumns(GetTable,{"ПАРАМЕТР", "ЗНАЧЕНИЕ", "ТИП"}), SetTypes = Table.TransformColumnTypes(KeepNeeded,{{"ПАРАМЕТР", type text}, {"ЗНАЧЕНИЕ", type any}, {"ТИП", type text}}), Filter = Table.SelectRows(SetTypes, each ([ПАРАМЕТР] = P_NAME)), Value = Table.SingleRow(Filter) @@ -14,9 +14,12 @@ let PATH_OVERRIDE = try if P_NAME = "PATH_OVERRIDE" then null else @fP("PATH_OVERRIDE") otherwise null, P_TYPE = if GET_PARAMETER <> null then - if P_FORCED_TYPE = null then GET_PARAMETER[ТИП] else P_FORCED_TYPE - else - null, + if P_FORCED_TYPE = null then + GET_PARAMETER[ТИП] + else + P_FORCED_TYPE + else + null, P_VALUE = if GET_PARAMETER <> null then if PATH_OVERRIDE <> null and @@ -64,7 +67,9 @@ let in Result, - // СПИСОК В ФОРМАТЕ PQ + // СПИСОК В ФОРМАТЕ PQ + // Ввод через точку с запятой, напр.: 1;2;яблоко;-10 + // Точка с запятой плюс пробел меняются на точку с запятой F_List = (Input as any) => let Result = Text.Split(Text.Replace(Text.From(Input), "; ", ";"), ";") in @@ -136,7 +141,7 @@ let SelectCase = List.First(List.Select(CaseValues, each _{0} = true)){1} - in - SelectCase + in + SelectCase in fP \ No newline at end of file