PowerQuery 如果有多个条件 AND OR
PowerQuery if with multiple conditions AND OR
如何在 PowerQuery 上复制它??
if(ATC[WorkitemAssetState]=64,
if(ATC[WorkitemIsClosed]=FALSE,
if(ATC[WorkitemIsDeleted]=FALSE,
if(ATC[M_WorkitemStatus]IN{"Reviewing","Available","Research","Progressing","Testing","Resolved","<none>"},
if(ATC[M_DefectResolutionId]IN {"-","<Unknown>","Resolution:1","Resolution:7"},1,-1)
,0)
,0)
,0)
,0)
我做了以下操作,但似乎不能正常工作:
if [WorkitemAssetState]=64 and
[WorkitemIsClosed]="FALSE" and
[WorkitemIsDeleted]="FALSE" and
[M_WorkitemStatus]="Reviewing" or [M_WorkitemStatus]= "Available" or [M_WorkitemStatus]= "Research" or [M_WorkitemStatus] = "Progressing" or [M_WorkitemStatus] = "Testing" or [M_WorkitemStatus] = "Resolved" or [M_WorkitemStatus] = "<none>" or [M_WorkitemStatus] = "<none>" or [M_WorkitemStatus] = "-" and
[M_DefectResolutionId]= "-" or [M_DefectResolutionId] = "<Unknown>" or [M_DefectResolutionId] = "Resolution:1" or[M_DefectResolutionId] = "Resolution:7" then 1 else 0
我很确定这是因为多个 OR 语句。
我不认为这是因为 FALSE
,顺便说一句。
谢谢!!
如果您不确定"and"和"or"的优先级,最好使用括号。
事实上,首先评估 "and",然后是 "or"。
所以 "a and b or c and d" 等价于“(a and b) or (c and d)”。
不是 "a and (b or c) and d",据我所知,您正在寻找。
如果是这样,您需要在 "or" 的集合周围添加括号。
假设您有逻辑值,那么 "FALSE" 将不起作用:您需要 false 不带引号且全部小写。
顺便说一下,"does not seem to work properly" 并不是解释问题所在的首选方式。我猜你(几乎)全是 1 而(几乎)没有 0?
如何在 PowerQuery 上复制它??
if(ATC[WorkitemAssetState]=64,
if(ATC[WorkitemIsClosed]=FALSE,
if(ATC[WorkitemIsDeleted]=FALSE,
if(ATC[M_WorkitemStatus]IN{"Reviewing","Available","Research","Progressing","Testing","Resolved","<none>"},
if(ATC[M_DefectResolutionId]IN {"-","<Unknown>","Resolution:1","Resolution:7"},1,-1)
,0)
,0)
,0)
,0)
我做了以下操作,但似乎不能正常工作:
if [WorkitemAssetState]=64 and
[WorkitemIsClosed]="FALSE" and
[WorkitemIsDeleted]="FALSE" and
[M_WorkitemStatus]="Reviewing" or [M_WorkitemStatus]= "Available" or [M_WorkitemStatus]= "Research" or [M_WorkitemStatus] = "Progressing" or [M_WorkitemStatus] = "Testing" or [M_WorkitemStatus] = "Resolved" or [M_WorkitemStatus] = "<none>" or [M_WorkitemStatus] = "<none>" or [M_WorkitemStatus] = "-" and
[M_DefectResolutionId]= "-" or [M_DefectResolutionId] = "<Unknown>" or [M_DefectResolutionId] = "Resolution:1" or[M_DefectResolutionId] = "Resolution:7" then 1 else 0
我很确定这是因为多个 OR 语句。
我不认为这是因为 FALSE
,顺便说一句。
谢谢!!
如果您不确定"and"和"or"的优先级,最好使用括号。
事实上,首先评估 "and",然后是 "or"。 所以 "a and b or c and d" 等价于“(a and b) or (c and d)”。 不是 "a and (b or c) and d",据我所知,您正在寻找。 如果是这样,您需要在 "or" 的集合周围添加括号。
假设您有逻辑值,那么 "FALSE" 将不起作用:您需要 false 不带引号且全部小写。
顺便说一下,"does not seem to work properly" 并不是解释问题所在的首选方式。我猜你(几乎)全是 1 而(几乎)没有 0?