我有以下代码:
let
Condition = Excel.CurrentWorkbook(){[Name="test_table"]}[Content],
field = Condition{0}[field_excel],
str = "One",
query = if field <> null
then str = "two"
else str = "three",
exec= Oracle.Database("TESTING", [Query=str])
in
exec
我希望条件str
的值为two
或three
,但始终保持One
答案 0 :(得分:1)
你想做这样的事情:
...
field = Condition{0}[field_excel],
str = if field <> null then "two" else "three",
exec = Oracle.Database("TESTING", [Query = str]),
...
Power Query不允许您将值重新分配给let表达式中的变量。相反,您可以将值分配给新变量。