我收到此错误存在未知标识符。您是否在“每个”表达式之外使用了 _[field] 的 [field] 简写
我创建了下面的函数,它根据 4 个输入列的值映射一个新列。该功能适用于我应用它的表。但是,当我将表加入另一个表时,我收到上述错误。
该函数的所有输入都是文本列。如果有人对此有一些经验,那将是一个很大的帮助。
// FNStage1Transform
let Stage1 = (term,investment_universe,Risk_tolerance,Special) =>
let
Stage1Transform =
if List.Contains({"Short","Intermediate"},term) and List.Contains({"Short","Aggregate","Gov/Credit"},investment_universe ) then term
else if term ="Full" then
if investment_universe = "Treasury" then term&" "& investment_universe
else if investment_universe ="TIPS" then "Full+Long"&" "&investment_universe
else if investment_universe ="Muni" and [Risk Tolerance] = "Conservative" then investment_universe
else if List.Contains({"Credit","Corp"},investment_universe) then "CredCorp"
else investment_universe
else if term = "Long" and investment_universe ="TIPS" then "Full+Long"&" "&investment_universe
else if term = "Long" and List.Contains({"Credit","Corp"},investment_universe) then term &" "&investment_universe
else if investment_universe = "Muni" and Risk_tolerance = "Conservative" then investment_universe
else if List.Contains({"Credit","Corp"},investment_universe) then term&" CredCorp"
else term &" "& investment_universe,
Stage2Transform = if List.Contains({"High Beta","Transition"},Risk_tolerance) then Risk_tolerance
else if Special = "Yes" then Stage1Transform &" "& Risk_tolerance & " Special"
else if Risk_tolerance = "Standard" then Stage1Transform
else Stage1Transform &" "&Risk_tolerance,
Stage3transform = "PS_"& Stage2Transform,
Result = Stage3transform
in Result
in
Stage1