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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Need help to retrieve first matched rows for multiple filter

I have 100 files and each contains something like below (there are thousands of rows on one file)
There is no guarantee that both "A" rows and "B" rows exist -- but in most cases we should have "A" rows, we may not have "B" rows sometimes.

20200129 900102 A

20200129 000103 A

20200129 000105 A

20200129 008202 B

20200129 009302 B

20200129 010345 B
20200129 010111 C

20200129 010222 D
...
How could I get the first "A" row and the first "B" row?
The expected result from above file should be:
20200129 900102 A
20200129 008202 B
(They are retrieved only because one is the first row with "A" and one is the first row with "B")
I will need to get them at almost the same time, because I have a logic :
if there is no "A" row, use the first "B" row's value, otherwise get "A" row's value.

If I ONLY need to process one file, I know how to do it: just using tFixedFlowInput to pass value
"A" and "B" into tMap as main, and use the file as lookup, use "A" , "B" value to do the join(match),  First Match, Inner join, I should be able to get the first "A" row and/or the first "B" row. But since I have 100 files that I want to process in this same way, I should not pass the hardcoded value "A" and "B" as "main".

Could someone please help me out?

Thanks!

Labels (3)
11 Replies
akumar2301
Specialist II
Specialist II

ok got it .

So you have list of row_code for all files to do lookup.
A
B
C
D
.
.

Anonymous
Not applicable
Author

The design I completed last night was a little more complicated because I was trying to implement the logic : if there is no "A" row, use the first "B" row's value, otherwise get "A" row's value.

This morning I talked to my colleagues and we confirmed my logic should be:

use First "A" row or First "B" row, either one is fine. So my current job was simplified.

BTW, in the file, the order of the code is random, it could be:
xxxxxxxxG
xxxxxxxxE
xxxxxxxxB
xxxxxxxxA
But the length is always the same and the code is always the last character. The order of the code appears doesn't matter though.