<?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: [resolved] Repeat query multiple times with different where condition in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-Repeat-query-multiple-times-with-different-where/m-p/2246186#M31799</link>
    <description>Hi
&lt;BR /&gt;Great! Thanks for your feedback!
&lt;BR /&gt;Best regards
&lt;BR /&gt;Shong</description>
    <pubDate>Mon, 05 Jan 2015 04:19:31 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-01-05T04:19:31Z</dc:date>
    <item>
      <title>[resolved] Repeat query multiple times with different where condition</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Repeat-query-multiple-times-with-different-where/m-p/2246181#M31794</link>
      <description>Hi All,
&lt;BR /&gt;
&lt;A href="http://www.talendforge.org/forum/img/members/207464/mini_Talend.jpeg.jpeg" target="_blank" rel="nofollow noopener noreferrer"&gt;http://www.talendforge.org/forum/img/members/207464/mini_Talend.jpeg.jpeg&lt;/A&gt;
&lt;BR /&gt;I have tow redshift component for the input. I am doing a join between them in tmap and then filtering it based on some condition.
&lt;BR /&gt;Query in my Redshift component has a where condition indicating a date range between which it needs to get data. Now I want to repeat it for multiple fixed dates. How can I automate it in Talend. Do we have any component for it?
&lt;BR /&gt;Thanks,
&lt;BR /&gt;Neil Shah</description>
      <pubDate>Fri, 02 Jan 2015 04:04:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Repeat-query-multiple-times-with-different-where/m-p/2246181#M31794</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-02T04:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Repeat query multiple times with different where condition</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Repeat-query-multiple-times-with-different-where/m-p/2246182#M31795</link>
      <description>Hi&amp;nbsp;
&lt;BR /&gt;I am not sure I understand your problem well, but you can try the tForEach component which can iterate each fixed dates provided by you, append the result of each iteration to the same file. For example:
&lt;BR /&gt;tForEach--iterate--your main business processing
&lt;BR /&gt;Best regards
&lt;BR /&gt;Shong</description>
      <pubDate>Fri, 02 Jan 2015 05:32:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Repeat-query-multiple-times-with-different-where/m-p/2246182#M31795</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-02T05:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Repeat query multiple times with different where condition</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Repeat-query-multiple-times-with-different-where/m-p/2246183#M31796</link>
      <description>Yes, that sounds a good idea. Thanks.&lt;BR /&gt;But, my each iteration would have 4 dates. (It is range) which I need to specify. I guess, by default, tforeach can contain 1 value. &lt;BR /&gt;Referring to &lt;A href="https://help.talend.com/search/all?query=tForeach&amp;amp;content-lang=en" target="_blank" rel="nofollow noopener noreferrer"&gt;https://help.talend.com/search/all?query=tForeach&amp;amp;content-lang=en&lt;/A&gt; &lt;BR /&gt;Not sure, if it would work, but adding 4 dates in one row and then taking a substring might work. But do we have any other option?&lt;BR /&gt;My query in 1 component looks like "Select a,b,c from table1 where date &amp;lt;'2013-01-01' and date &amp;gt;'2012-01-01'&lt;BR /&gt;My query in 2nd component looks like "Select x,y,a from table2 where date &amp;lt;'2012-05-05' and date &amp;gt; '2013-02-02' "&lt;BR /&gt;For each iteration, all 4 date values would change.&lt;BR /&gt;Thanks,&lt;BR /&gt;Neil Shah</description>
      <pubDate>Fri, 02 Jan 2015 05:52:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Repeat-query-multiple-times-with-different-where/m-p/2246183#M31796</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-02T05:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Repeat query multiple times with different where condition</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Repeat-query-multiple-times-with-different-where/m-p/2246184#M31797</link>
      <description>Hi 
&lt;BR /&gt;You can also use tFixedFlowInput to define the input data, define 4 columns for each date and iterate each row with tFlowToIterate, for example: 
&lt;BR /&gt;parent job: 
&lt;BR /&gt;tFixedFlowInput--main(row1)-tFlowToiterate--iterate--tRunJob 
&lt;BR /&gt;tRunJob: call the child job, and pass the current 4 dates to child job, see this 
&lt;A href="https://help.talend.com/pages/viewpage.action?pageId=190513193" target="_blank" rel="nofollow noopener noreferrer"&gt;article &lt;/A&gt;to know how to pass a value from parent job to child job via context variable. 
&lt;BR /&gt;child job:' 
&lt;BR /&gt;txxxInput_1--main--tMap--&amp;gt; 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp; 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; txxxInput_2 
&lt;BR /&gt;on DB input component, define the query like: 
&lt;BR /&gt; 
&lt;FONT size="1"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;"Select a,b,c from table1 where date &amp;lt;'"+context.firstDate+"' and date &amp;gt;'"+context.secondDate+"'"&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="1"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;Best regards&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;&lt;FONT size="1"&gt;Shong&lt;/FONT&gt;&lt;/FONT&gt;</description>
      <pubDate>Fri, 02 Jan 2015 10:55:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Repeat-query-multiple-times-with-different-where/m-p/2246184#M31797</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-02T10:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Repeat query multiple times with different where condition</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Repeat-query-multiple-times-with-different-where/m-p/2246185#M31798</link>
      <description>Hi Shong, 
&lt;BR /&gt;Thanks for your reply. I somehow update the query to not include the date for second part (So Now only 2 date conditions instead of 4) and actually made it work with below method:- 
&lt;BR /&gt;tforeach -&amp;gt; RedshiftInput -- tmap 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Another input 
&lt;BR /&gt;in tforeach, I put date as "2015-01-01,2014-10-01" and then in query i used it as follows 
&lt;BR /&gt;"select a,b,c 
&lt;BR /&gt;from table_a 
&lt;BR /&gt;and created_date &amp;lt;' "+ ((String)globalMap.get("tForeach_1_CURRENT_VALUE")).split(",")+" ' 
&lt;BR /&gt;and created_date &amp;gt;=' "+ ((String)globalMap.get("tForeach_1_CURRENT_VALUE")).split(",")+" ' "</description>
      <pubDate>Mon, 05 Jan 2015 02:14:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Repeat-query-multiple-times-with-different-where/m-p/2246185#M31798</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-05T02:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Repeat query multiple times with different where condition</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Repeat-query-multiple-times-with-different-where/m-p/2246186#M31799</link>
      <description>Hi
&lt;BR /&gt;Great! Thanks for your feedback!
&lt;BR /&gt;Best regards
&lt;BR /&gt;Shong</description>
      <pubDate>Mon, 05 Jan 2015 04:19:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Repeat-query-multiple-times-with-different-where/m-p/2246186#M31799</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-05T04:19:31Z</dc:date>
    </item>
  </channel>
</rss>

