<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Need help to retrieve  first matched rows for multiple filter in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Need-help-to-retrieve-first-matched-rows-for-multiple-filter/m-p/2275885#M52129</link>
    <description>&lt;P&gt;Thank you for the quick feedback!&lt;BR /&gt;&lt;BR /&gt;I don't see how your code would get the FIRST "A" row or the FIRST "B" row.&lt;BR /&gt;Did I miss something?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 30 Jan 2020 06:10:05 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-01-30T06:10:05Z</dc:date>
    <item>
      <title>Need help to retrieve  first matched rows for multiple filter</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Need-help-to-retrieve-first-matched-rows-for-multiple-filter/m-p/2275883#M52127</link>
      <description>&lt;P&gt;I have &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;100&lt;/STRONG&gt;&amp;nbsp;&lt;FONT color="#000000"&gt;files and each contains something like below (there are thousands of rows on one file)&lt;BR /&gt;There is no &lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;20200129 900102 A&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;20200129 000103 A&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;20200129 000105 A&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;20200129 008202 B&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;20200129 009302 B&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;20200129 010345 B&lt;BR /&gt;20200129 010111 C&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;20200129 010222 D&lt;BR /&gt;...&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;How could I get the first "A" row and the first "B" row?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;The expected result from above file should be:&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;20200129 900102 A&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;20200129 008202 B&lt;BR /&gt;&lt;/FONT&gt;(&lt;FONT color="#FF0000"&gt;They are retrieved only because one is the first row with "A" and one is the first row with "B"&lt;/FONT&gt;)&lt;BR /&gt;I will need to get them at almost the same time, because I have a logic :&lt;BR /&gt;if there is no "A" row, use the first "B" row's value, otherwise get "A" row's value.&lt;BR /&gt;&lt;BR /&gt;If I ONLY need to process one file, I know how to do it: just using tFixedFlowInput to pass value&lt;BR /&gt;"A" and "B" into tMap as main, and use the file as lookup, use "A" , "B" value to do the join(match),&amp;nbsp; First Match, Inner join, I should be able to get the first "A" row and/or the first "B" row. But since I have&amp;nbsp;100 files that I want to process in this same way, I should not pass the hardcoded value "A" and "B" as "main".&lt;BR /&gt;&lt;BR /&gt;Could someone please help me out?&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:24:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Need-help-to-retrieve-first-matched-rows-for-multiple-filter/m-p/2275883#M52127</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T03:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to retrieve  first matched rows for multiple filter</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Need-help-to-retrieve-first-matched-rows-for-multiple-filter/m-p/2275884#M52128</link>
      <description>What if you use this within a tJavaRow :&lt;BR /&gt;output_row.line = input_row.line;&lt;BR /&gt;input_row.line.contains("A") ? ((String)globalMap.get("A")) == null ? globalMap.put("A", input_row.line) : ((String)globalMap.get("A")) :&lt;BR /&gt;((String)globalMap.get("B")) == null ? globalMap.put("B", input_row.line) : (String)globalMap.get("B");&lt;BR /&gt;&lt;BR /&gt;At the end, bot A and B global variables should contain what you want.</description>
      <pubDate>Thu, 30 Jan 2020 06:00:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Need-help-to-retrieve-first-matched-rows-for-multiple-filter/m-p/2275884#M52128</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2020-01-30T06:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to retrieve  first matched rows for multiple filter</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Need-help-to-retrieve-first-matched-rows-for-multiple-filter/m-p/2275885#M52129</link>
      <description>&lt;P&gt;Thank you for the quick feedback!&lt;BR /&gt;&lt;BR /&gt;I don't see how your code would get the FIRST "A" row or the FIRST "B" row.&lt;BR /&gt;Did I miss something?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 06:10:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Need-help-to-retrieve-first-matched-rows-for-multiple-filter/m-p/2275885#M52129</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-30T06:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to retrieve  first matched rows for multiple filter</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Need-help-to-retrieve-first-matched-rows-for-multiple-filter/m-p/2275886#M52130</link>
      <description>This piece of code set a global variable "A" with the first line which contain A.&lt;BR /&gt;It also set a global variable "B" with the first line which contain B.&lt;BR /&gt;If you want the first A or B, just use the same variable for both.&lt;BR /&gt;After tJavaRow you can use a tFixedFlowInput to start a new flow with these variables to populate the desired fields.</description>
      <pubDate>Thu, 30 Jan 2020 06:50:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Need-help-to-retrieve-first-matched-rows-for-multiple-filter/m-p/2275886#M52130</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2020-01-30T06:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to retrieve  first matched rows for multiple filter</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Need-help-to-retrieve-first-matched-rows-for-multiple-filter/m-p/2275887#M52131</link>
      <description>&lt;P&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;I think I have figured out how to accomplish this with a bunch of components&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACJ.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133049iD780B7DE0116E4D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACJ.png" alt="0683p000009MACJ.png" /&gt;&lt;/span&gt;&lt;BR /&gt;But I will try your code tomorrow.&lt;BR /&gt;I still have a little difficulty understanding how the code would give the First "A" and "B".&lt;BR /&gt;I don't have much k&lt;SPAN&gt;nowledge of Java language and am not too familiar with tJavaRow either -- the only times that I used tJavaRow was to create global variables when there is only ONE row in the input flow. But for my files, there would be thousands of the rows in the input flow, how it only has one output?&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 07:20:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Need-help-to-retrieve-first-matched-rows-for-multiple-filter/m-p/2275887#M52131</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-30T07:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to retrieve  first matched rows for multiple filter</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Need-help-to-retrieve-first-matched-rows-for-multiple-filter/m-p/2275888#M52132</link>
      <description>&lt;P&gt;Here is the trick:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;input_row.line.contains("A") ?&amp;nbsp;&lt;/SPAN&gt;((String)globalMap.get("A")) == null ? globalMap.put("A", input_row.line) : ((String)globalMap.get("A"))&lt;/PRE&gt;&lt;P&gt;Read it like this:&lt;/P&gt;&lt;PRE&gt;if current line contains A
  if global variable A is null put current line to A else (because it is mandatory) put current value of A to A&lt;/PRE&gt;&lt;P&gt;Got it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 07:34:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Need-help-to-retrieve-first-matched-rows-for-multiple-filter/m-p/2275888#M52132</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2020-01-30T07:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to retrieve  first matched rows for multiple filter</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Need-help-to-retrieve-first-matched-rows-for-multiple-filter/m-p/2275889#M52133</link>
      <description>Hello did you try taggregaterow with First as aggregate function</description>
      <pubDate>Thu, 30 Jan 2020 13:01:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Need-help-to-retrieve-first-matched-rows-for-multiple-filter/m-p/2275889#M52133</guid>
      <dc:creator>akumar2301</dc:creator>
      <dc:date>2020-01-30T13:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to retrieve  first matched rows for multiple filter</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Need-help-to-retrieve-first-matched-rows-for-multiple-filter/m-p/2275890#M52134</link>
      <description>&lt;P&gt;I used tSampleRow and Range value "1" to get the first row.&lt;BR /&gt;&lt;BR /&gt;Now I realize tAggregateRow-&amp;gt; First probably would be easier for other developers to understand for future support.&lt;BR /&gt;&lt;BR /&gt;But I don't know from performance point, which one would be better,&amp;nbsp;tSampleRow vs&amp;nbsp;tAggregateRow?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 15:27:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Need-help-to-retrieve-first-matched-rows-for-multiple-filter/m-p/2275890#M52134</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-30T15:27:58Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to retrieve  first matched rows for multiple filter</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Need-help-to-retrieve-first-matched-rows-for-multiple-filter/m-p/2275891#M52135</link>
      <description>I am not sure how did you get correct result based on tSampleRow but i your logic works&lt;BR /&gt;&lt;BR /&gt;tSampleRow will give better perormance.</description>
      <pubDate>Thu, 30 Jan 2020 15:38:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Need-help-to-retrieve-first-matched-rows-for-multiple-filter/m-p/2275891#M52135</guid>
      <dc:creator>akumar2301</dc:creator>
      <dc:date>2020-01-30T15:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to retrieve  first matched rows for multiple filter</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Need-help-to-retrieve-first-matched-rows-for-multiple-filter/m-p/2275892#M52136</link>
      <description>&lt;P&gt;Here is my design:&lt;BR /&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="005.JPG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8wy.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/136493i215CF878AD9D5E2A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8wy.jpg" alt="0683p000009M8wy.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;When reading the files, I used the Stringhandling function to get the "A" or "B" value into a Row_Code field. And then inside tMap, I join Row_Code with Code ( hardcoded as "A" and "B" in tFixedFlowInput).&lt;BR /&gt;&lt;BR /&gt;My real logic should be:&amp;nbsp; get the First A row or First B row, which ever is fine.&lt;BR /&gt;Because of the "Inner Join" I used in tMap, &amp;amp; tSampleRow (range "1"), I was able to accomplish that.&lt;BR /&gt;&lt;BR /&gt;I am still doing the test, but it seems to me, the job would not fail if the file doesn't have A rows or B rows at all.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 16:00:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Need-help-to-retrieve-first-matched-rows-for-multiple-filter/m-p/2275892#M52136</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-30T16:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to retrieve  first matched rows for multiple filter</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Need-help-to-retrieve-first-matched-rows-for-multiple-filter/m-p/2275893#M52137</link>
      <description>ok got it .&lt;BR /&gt;&lt;BR /&gt;So you have list of row_code for all files to do lookup.&lt;BR /&gt;A&lt;BR /&gt;B&lt;BR /&gt;C&lt;BR /&gt;D&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 30 Jan 2020 16:22:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Need-help-to-retrieve-first-matched-rows-for-multiple-filter/m-p/2275893#M52137</guid>
      <dc:creator>akumar2301</dc:creator>
      <dc:date>2020-01-30T16:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to retrieve  first matched rows for multiple filter</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Need-help-to-retrieve-first-matched-rows-for-multiple-filter/m-p/2275894#M52138</link>
      <description>&lt;P&gt;The design I completed last night was a little more complicated because I was trying to implement the logic :&amp;nbsp;&lt;SPAN&gt;if there is no "A" row, use the first "B" row's value, otherwise get "A" row's value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;This morning I talked to my colleagues and we confirmed my logic should be:&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;use First "A" row or First "B" row, either one is fine.&amp;nbsp;&lt;FONT color="#000000"&gt;So my current job was simplified.&lt;BR /&gt;&lt;BR /&gt;BTW, in the file, the order of the code is random, it could be:&lt;BR /&gt;xxxxxxxxG&lt;BR /&gt;xxxxxxxxE&lt;BR /&gt;xxxxxxxxB&lt;BR /&gt;xxxxxxxxA&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 16:40:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Need-help-to-retrieve-first-matched-rows-for-multiple-filter/m-p/2275894#M52138</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-30T16:40:09Z</dc:date>
    </item>
  </channel>
</rss>

