<?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 Can I branch in Talend for different Cases in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Can-I-branch-in-Talend-for-different-Cases/m-p/2370409#M133454</link>
    <description>&lt;P&gt;Hello All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have 2 cases in input file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The input is like below for the CHG_CLASS which has input value of single fp line item. And I am executing some update logic using tMySQLRow&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CHG_CLASS&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CHG_AMT&amp;nbsp;&lt;/P&gt;
&lt;P&gt;fp&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;/P&gt;
&lt;P&gt;mrc&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;10.00&lt;/P&gt;
&lt;P&gt;mrc&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; 20.00&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Suppose my input file has multiple line items has below input (Having multiple fp lines items)&lt;/P&gt;
&lt;P&gt;CHG_CLASS&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CHG_AMT&lt;/P&gt;
&lt;P&gt;fp&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;/P&gt;
&lt;P&gt;fp&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;/P&gt;
&lt;P&gt;mrc&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;10.00&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;mrc&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;20.00&lt;/P&gt;
&lt;P&gt;mrc&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;30.00&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And in this case if input has multiple line items I want to update my data with some logic using tMySQLROW.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My question is - is there any component using which I can branch the update statement for the above cases?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if my input file has one fp line items execute some update statement using tMySQLROW&lt;/P&gt;
&lt;P&gt;else execute some other update statement using tMySQLROW.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Deepak&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Feb 2018 13:00:02 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-02-20T13:00:02Z</dc:date>
    <item>
      <title>Can I branch in Talend for different Cases</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Can-I-branch-in-Talend-for-different-Cases/m-p/2370409#M133454</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have 2 cases in input file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The input is like below for the CHG_CLASS which has input value of single fp line item. And I am executing some update logic using tMySQLRow&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CHG_CLASS&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CHG_AMT&amp;nbsp;&lt;/P&gt;
&lt;P&gt;fp&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;/P&gt;
&lt;P&gt;mrc&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;10.00&lt;/P&gt;
&lt;P&gt;mrc&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; 20.00&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Suppose my input file has multiple line items has below input (Having multiple fp lines items)&lt;/P&gt;
&lt;P&gt;CHG_CLASS&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CHG_AMT&lt;/P&gt;
&lt;P&gt;fp&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;/P&gt;
&lt;P&gt;fp&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;/P&gt;
&lt;P&gt;mrc&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;10.00&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;mrc&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;20.00&lt;/P&gt;
&lt;P&gt;mrc&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;30.00&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And in this case if input has multiple line items I want to update my data with some logic using tMySQLROW.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My question is - is there any component using which I can branch the update statement for the above cases?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if my input file has one fp line items execute some update statement using tMySQLROW&lt;/P&gt;
&lt;P&gt;else execute some other update statement using tMySQLROW.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Deepak&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 13:00:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Can-I-branch-in-Talend-for-different-Cases/m-p/2370409#M133454</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-20T13:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can I branch in Talend for different Cases</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Can-I-branch-in-Talend-for-different-Cases/m-p/2370410#M133455</link>
      <description>&lt;P&gt;You should be able to prepare the query into a global variable depending on your condition (1 or more fp lines), then reuse the query into the tMySQLRow component.&lt;/P&gt; 
&lt;P&gt;tAggregateRow is a candidate to compute the number of fp records (or tMap or tJavaRow combined with a sequence).&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 13:11:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Can-I-branch-in-Talend-for-different-Cases/m-p/2370410#M133455</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2018-02-20T13:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: Can I branch in Talend for different Cases</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Can-I-branch-in-Talend-for-different-Cases/m-p/2370411#M133456</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks for your quick reply on this. Here if you can see at the right side I am loading the data and in the left after subjobok -&amp;gt; I am executing the query for 1 fp line items. Where should use tAggregaterow to check the condition where it has 1 fp line items or more than 1 fp line items?&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Please advice and also if I get the syntax how I can check multiple/single line items would be great help.The variable name is CHG_CLASS which has fp values.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="loadworkflow.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lsjp.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/151257i568F3A39F874625F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lsjp.png" alt="0683p000009Lsjp.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 13:31:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Can-I-branch-in-Talend-for-different-Cases/m-p/2370411#M133456</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-20T13:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: Can I branch in Talend for different Cases</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Can-I-branch-in-Talend-for-different-Cases/m-p/2370412#M133457</link>
      <description>&lt;P&gt;tMysqlRow_2 is the place where you get the data to know if there 1 or more fp line, right?&lt;/P&gt; 
&lt;P&gt;If you just want to know how many fp line the query returns, you may transform it to a "select count" (other idea came after the previous answer).&lt;/P&gt; 
&lt;P&gt;To answer your question, the simplest way is to use a tJavaRow connected to&amp;nbsp;&lt;SPAN&gt;tMy&lt;/SPAN&gt;&lt;SPAN&gt;sql&lt;/SPAN&gt;&lt;SPAN&gt;Row_2&amp;nbsp;&lt;/SPAN&gt;like this:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;input_row.CHG_CLASS.equals ("fp") ? Numeric.sequence("fp", 1, 1) : null;
output_row.CHG_CLASS&amp;nbsp;=&amp;nbsp;input_row.CHG_CLASS;&lt;/PRE&gt; 
&lt;P&gt;&lt;SPAN&gt;At the end you have a global variable called "fp" which contains the number of fp lines.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;You may use it like this:&lt;/SPAN&gt;&lt;/P&gt; 
&lt;PRE&gt;((Integer)globalMap.get("fp")) != null &amp;amp;&amp;amp; ((Integer)globalMap.get("fp")) &amp;gt; 1&lt;/PRE&gt; 
&lt;P&gt;&lt;SPAN&gt;You may use it&amp;nbsp;as a condition for an "If" connector.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 14:04:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Can-I-branch-in-Talend-for-different-Cases/m-p/2370412#M133457</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2018-02-20T14:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Can I branch in Talend for different Cases</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Can-I-branch-in-Talend-for-different-Cases/m-p/2370413#M133458</link>
      <description>&lt;P&gt;Hi Fred,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I have tried the below as you suggested&lt;/P&gt; 
&lt;P&gt;tMySQLOutput_1 will get the data loaded to table.&lt;/P&gt; 
&lt;P&gt;In the tJavaRow_1&amp;nbsp;&lt;BR /&gt;I have the code as you suggested - But tJavaRow_1 is giving me error&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="testworkflow2.PNG" style="width: 776px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LsdI.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/155538i7CBCF47C09FE0397/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LsdI.png" alt="0683p000009LsdI.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;input_row.CHG_CLASS.equals ("fp") ? Numeric.sequence("fp", 1, 1) : null;
output_row.CHG_CLASS&amp;nbsp;=&amp;nbsp;input_row.CHG_CLASS;&lt;/PRE&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="testworkflow.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lsdg.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/132964iA603882DD0BBEF4A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lsdg.png" alt="0683p000009Lsdg.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;The sequence in which I have put the components are correct? Please advice.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Regards,&lt;/P&gt; 
&lt;P&gt;Deepak&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 06:41:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Can-I-branch-in-Talend-for-different-Cases/m-p/2370413#M133458</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-23T06:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: Can I branch in Talend for different Cases</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Can-I-branch-in-Talend-for-different-Cases/m-p/2370414#M133459</link>
      <description>&lt;P&gt;I just forget the left part of the assignment.&lt;/P&gt;
&lt;P&gt;Can't review all the topic but if I remember you want to know how many fp line are in the file.&lt;/P&gt;
&lt;P&gt;Should looks like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;globalMap.put("fpLines", input_row.CHG_CLASS.equals ("fp") ? Numeric.sequence("fp", 1, 1) : null;
output_row.CHG_CLASS&amp;nbsp;=&amp;nbsp;input_row.CHG_CLASS;&lt;/PRE&gt;
&lt;P&gt;This will assign the value to a global variable called "fpLines".&lt;/P&gt;
&lt;P&gt;Now you can reuse it where you want.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 17:56:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Can-I-branch-in-Talend-for-different-Cases/m-p/2370414#M133459</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2018-02-23T17:56:17Z</dc:date>
    </item>
  </channel>
</rss>

