Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us at Qlik Connect 2026 in Orlando, April 13–15: Register Here!
cancel
Showing results for 
Search instead for 
Did you mean: 
lzzoe
Contributor II
Contributor II

Filter records based on columns of another table

Dear All,

I am quite new to Qlik. I want to filter records (table A+B) based on the columns from both table A and table B.

After inner joining table A and table B by using col Key, I want to select only records with AMT within Range1 and Range2. May I ask if I want to do this in data load editor, what function should I use? Thank you

TableA: 

Key Range1 Range2
123 1 10
134 10 1000
185 5 8
199 7 200

 

TableB:

Key AMT
123 5
134 290
185 46
199 35

 

After joining and filter Range1<=AMT<=Range2:

Key AMT
123 5
134 290
199 35

Labels (3)
4 Replies
Sierd_Boersma
Partner - Contributor II
Partner - Contributor II

Yiou can use IntervalMatch, which checks wether a value falls within a ragen, The script will then look something like this:

inner join([TableB])
IntervalMatch(AMT, Key)
LOAD
Range1
,Range2
,Key
Resident TableA;



Chanty4u
MVP
MVP

Try this 

TableA:

LOAD

    Key,

    Range1,

    Range2

INLINE [

Key, Range1, Range2

123, 1, 10

134, 10, 1000

185, 5, 8

199, 7, 200

];

 

INNER JOIN (TableA)

LOAD

    Key,

    AMT

INLINE [

Key, AMT

123, 5

134, 290

185, 46

199, 35

]

WHERE AMT >= Ran

ge1

  AND AMT <= Range2;

Chanty4u
MVP
MVP

Try this 

TableA:

LOAD

    Key,

    Range1,

    Range2

INLINE [

Key, Range1, Range2

123, 1, 10

134, 10, 1000

185, 5, 8

199, 7, 200

];

 

INNER JOIN (TableA)

LOAD

    Key,

    AMT

INLINE [

Key, AMT

123, 5

134, 290

185, 46

199, 35

]

WHERE AMT >= Ran

ge1

  AND AMT <= Range2;

HirisH_V7
Master
Master

This would do.

TableA:
LOAD
    Key,
    Range1,
    Range2
INLINE [
Key, Range1, Range2
123, 1, 10
134, 10, 1000
185, 5, 8
199, 7, 200
];

TableB:
LOAD
    Key,
    AMT
INLINE [
Key, AMT
123, 5
134, 290
185, 46
199, 35
];

IntervalMatch (AMT)
LOAD
    Range1,
    Range2
RESIDENT TableA;

Inner Join (TableA)
LOAD
    Key,
    AMT
RESIDENT TableB;

FinalTable:
LOAD
    Key,
    AMT
RESIDENT TableA;

DROP TABLE TableA;
DROP TABLE TableB;

 

HirisH