Power Query——本机查询中的列表值
Power Query -- list value in native query
我在本机查询中使用 "in" 运算符时遇到问题,其中 in 参数是通过钻取 excel 列检索的列表 table:
let
var = Number.ToText(fnFuncao("externalcode")),
Coluna= Excel.CurrentWorkbook(){[Name="Pendente"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Coluna,{{"PARAMETER", Int64.Type}, {"INTERACTION_ID", Int64.Type}, {"INTERACTION_ITEM", Int64.Type}}),
INTERACTION_ID = #"Changed Type"[INTERACTION_ID][0],
Source = Oracle.Database("somp", [Query="select * from ish.ticket where interaction_id in (" & INTERACTION_ID & ") "])
in
Source
Error:
Expression.Error: We cannot apply operator & to types Text and List.
Details:
Operator=&
Left=select * from ish.ticket where interaction_id in (
Right=List
有什么办法解决这个问题吗?
谢谢!
我不知道为什么 INTERACTION_ID 被当作列表对待。这两项更改应该可以解决您的问题:
- 将INTERACTION_ID更改为
#"Changed Type"[INTERACTION_ID]{0},
- 将查询设置为
"select * from ish.ticket where interaction_id in (" & Number.ToText(INTERACTION_ID) & ")"
第一个更改使用列表访问运算符 {} 而不是记录访问运算符 []。第二个更改将 INTERACTION_ID 转换为文本值,以便可以使用 &.
将其添加到其他文本值
我在本机查询中使用 "in" 运算符时遇到问题,其中 in 参数是通过钻取 excel 列检索的列表 table:
let
var = Number.ToText(fnFuncao("externalcode")),
Coluna= Excel.CurrentWorkbook(){[Name="Pendente"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Coluna,{{"PARAMETER", Int64.Type}, {"INTERACTION_ID", Int64.Type}, {"INTERACTION_ITEM", Int64.Type}}),
INTERACTION_ID = #"Changed Type"[INTERACTION_ID][0],
Source = Oracle.Database("somp", [Query="select * from ish.ticket where interaction_id in (" & INTERACTION_ID & ") "])
in
Source
Error:
Expression.Error: We cannot apply operator & to types Text and List.
Details:
Operator=&
Left=select * from ish.ticket where interaction_id in (
Right=List
有什么办法解决这个问题吗? 谢谢!
我不知道为什么 INTERACTION_ID 被当作列表对待。这两项更改应该可以解决您的问题:
- 将INTERACTION_ID更改为
#"Changed Type"[INTERACTION_ID]{0},
- 将查询设置为
"select * from ish.ticket where interaction_id in (" & Number.ToText(INTERACTION_ID) & ")"
第一个更改使用列表访问运算符 {} 而不是记录访问运算符 []。第二个更改将 INTERACTION_ID 转换为文本值,以便可以使用 &.
将其添加到其他文本值