Sql QlikView挑战匹配逻辑

Sql QlikView挑战匹配逻辑,sql,join,concatenation,match,qlikview,Sql,Join,Concatenation,Match,Qlikview,我需要一些QlikView逻辑方面的帮助,到目前为止,它一直在挑战我。我们在QlikView服务器上加载了2个表 表A和表B 表A有“AValue1”和“AValue2”列 表B有“BValue1”、“BValue2”、“BValue3”和“BValue4”、“BValue5” 逻辑是这样的(翻译自vb脚本) 对于表A中的每一行 i) if (BValue1 <= AValue1 <= BValue3) and (BValue2 <= AValue2 <= BValue4

我需要一些QlikView逻辑方面的帮助,到目前为止,它一直在挑战我。我们在QlikView服务器上加载了2个表

表A和表B

表A有“AValue1”和“AValue2”列

表B有“BValue1”、“BValue2”、“BValue3”和“BValue4”、“BValue5”

逻辑是这样的(翻译自vb脚本)

对于表A中的每一行

i) if (BValue1 <= AValue1 <= BValue3) and (BValue2 <= AValue2 <= BValue4) then return 'BValue5' 

ii) if the first condition is not met, run the following:

if AValue1 exists in TableB.BValue1, then check:

if BValue2 <=AValue2<=BValue4, then return 'BValue5'

iii) if the second condition is not met, run the following:

if AValue2 exists in TableB.BValue2, then check:

if BValue1 <= AValue1 <= BValue3 then, return 'BValue5'.

iv) if nothing from the above is complete, then return blank.

i)if(BValue1尝试多个
if
语句和
Wildmatch
的组合

IF((BValue1 <= AValue1 and AValue1 <= BValue3) and (BValue2 <= AValue2 and AValue2 <= BValue4), BValue5, 
  IF(Wildmatch(AValue1 , TableB.BValue1), 
    IF((BValue2 <=AValue2 and AValue2 <= BValue4), BValue5, 
      IF(Wildmatch(AValue2 , TableB.BValue2), 
        IF((BValue1 <=AValue1 and AValue1 <= BValue3), BValue5,'blank')))))

IF((b值1您可以在QlikView中编写SQL。在SQL中使用
JOIN
CASE
语句。在执行SQL语句的
LOAD
时,您也可以使用
IF
。如果您向我们展示表a和表B中包含一些数据的结构以及预期结果,可能会有人帮助您。此外,QlikView社区可能是一个很好的解决方案蕾丝询问QlikView的具体答案。