Skip to main content
Do More with Qlik - Qlik Cloud Analytics Recap and Getting Started, June 19: REGISTER
Showing results for 
Search instead for 
Did you mean: 
Contributor II
Contributor II

QlikView challenging match logic

Hi all, 

I need some help with a QlikView logic which keeps challenging me so far. We have 2 tables loaded onto QlikView server.

TableA and TableB.

TableA has columns 'AValue1' and 'AValue2'.

TableB has 'BValue1', 'BValue2', 'BValue3' and 'BValue4', 'BValue5'.

The logic goes like that (translated from vb script)

For each line in TableA

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.
  • Table2 has many blank values in all its different columns *

How the above can be built in QlikView?


Thanks in advance.

Labels (1)
3 Replies
Partner - Champion III
Partner - Champion III

I am not sure what you are trying to do here, but this is not valid Qlik syntax

if BValue1 <= AValue1 <= BValue3 then...

Perhaps you mean

if BValue1 <= AValue1 And AValue1 <= BValue3 then...
Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

You can use nested if like this,

=If(conditionA ,








Also you can refer this thread, a bit different but might helpful,

Partner - Creator III
Partner - Creator III


How does TableA relate with TableB? Condition i) says

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

but, given a value of the column AValue1 (i.e., given a row of TableA), which rows of BValue1, BValue2, BValue3 and BValue4 are to be compared with that AValue1