<?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 Iterate the result from tSYstem in tJava in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Iterate-the-result-from-tSYstem-in-tJava/m-p/2313856#M84674</link>
    <description>&lt;P&gt;I am currently trying to loop the result i fetched from tSystem using tJava. My workflow is:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000SsjB4AAJ.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133741i4390F32CD59ABD1E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000SsjB4AAJ.png" alt="0695b00000SsjB4AAJ.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result from tSystem (Note : The result is much more than in example below) :﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;I&gt;Ingestion table_202207&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;{'Destination TblName': u'table_202207', Execution time': 112.25, 'Ingested rows': 0}&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;End_table_202207&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;I&gt;Ingestion table_202208&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;{'Destination TblName': u'table_2022078, Execution time': 2.20, 'Ingested rows': 764}&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;End_table_202208&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;....&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In tJava:&lt;/P&gt;&lt;P&gt;String output=((String)globalMap.get("tSystem_3_OUTPUT"));&lt;/P&gt;&lt;P&gt;System.out.println("OUTPUT FROM TSYSTEM_3: "+output);&lt;/P&gt;&lt;P&gt;String json_output=StringUtils.substringBetween(output,"&lt;I&gt;ngestion table&lt;/I&gt;, "&lt;I&gt;End_table&lt;/I&gt;");&lt;/P&gt;&lt;P&gt;System.out.println(json_output);&lt;/P&gt;&lt;P&gt;//for (String i : json_output) {&lt;/P&gt;&lt;P&gt;//&amp;nbsp;&amp;nbsp;System.out.println(i);&lt;/P&gt;&lt;P&gt;//}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am quite confused how should I get the value from tSystem and and loop for between string Ingestion-somedate and &lt;I&gt;End_table_somedate.n&lt;/I&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Nov 2024 22:43:14 GMT</pubDate>
    <dc:creator>WSyahirah21</dc:creator>
    <dc:date>2024-11-15T22:43:14Z</dc:date>
    <item>
      <title>Iterate the result from tSYstem in tJava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Iterate-the-result-from-tSYstem-in-tJava/m-p/2313856#M84674</link>
      <description>&lt;P&gt;I am currently trying to loop the result i fetched from tSystem using tJava. My workflow is:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000SsjB4AAJ.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133741i4390F32CD59ABD1E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000SsjB4AAJ.png" alt="0695b00000SsjB4AAJ.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result from tSystem (Note : The result is much more than in example below) :﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;I&gt;Ingestion table_202207&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;{'Destination TblName': u'table_202207', Execution time': 112.25, 'Ingested rows': 0}&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;End_table_202207&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;I&gt;Ingestion table_202208&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;{'Destination TblName': u'table_2022078, Execution time': 2.20, 'Ingested rows': 764}&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;End_table_202208&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;....&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In tJava:&lt;/P&gt;&lt;P&gt;String output=((String)globalMap.get("tSystem_3_OUTPUT"));&lt;/P&gt;&lt;P&gt;System.out.println("OUTPUT FROM TSYSTEM_3: "+output);&lt;/P&gt;&lt;P&gt;String json_output=StringUtils.substringBetween(output,"&lt;I&gt;ngestion table&lt;/I&gt;, "&lt;I&gt;End_table&lt;/I&gt;");&lt;/P&gt;&lt;P&gt;System.out.println(json_output);&lt;/P&gt;&lt;P&gt;//for (String i : json_output) {&lt;/P&gt;&lt;P&gt;//&amp;nbsp;&amp;nbsp;System.out.println(i);&lt;/P&gt;&lt;P&gt;//}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am quite confused how should I get the value from tSystem and and loop for between string Ingestion-somedate and &lt;I&gt;End_table_somedate.n&lt;/I&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 22:43:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Iterate-the-result-from-tSYstem-in-tJava/m-p/2313856#M84674</guid>
      <dc:creator>WSyahirah21</dc:creator>
      <dc:date>2024-11-15T22:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: Iterate the result from tSYstem in tJava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Iterate-the-result-from-tSYstem-in-tJava/m-p/2313857#M84675</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;What's the output of ((String)globalMap.get("tSystem_3_OUTPUT"))? can you show an example?&lt;/P&gt;&lt;P&gt;what are your expect result?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 03:28:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Iterate-the-result-from-tSYstem-in-tJava/m-p/2313857#M84675</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-22T03:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: Iterate the result from tSYstem in tJava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Iterate-the-result-from-tSYstem-in-tJava/m-p/2313858#M84676</link>
      <description>&lt;P&gt;Hi Shong, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently im trying to get the data value for multiple table using loop function using tJavaFlex in talend. The result of variable &lt;B&gt;string ingestTbl &lt;/B&gt;in below command is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;I&gt;{'Source rows': 818113, 'Destination rows': 548940}&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;{'Source rows': 224, 'Destination rows': 5445}&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;{'Source rows': 57675, 'Destination rows': 57567}&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tJavaFlex command:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;for (int i = 0,; i&amp;lt; strArray.length; i++){&amp;nbsp;&amp;nbsp;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&amp;nbsp;&amp;nbsp;String ingestTbl=StringUtils.substringBetween(output,"Ingestion Stats for Table "+strArray[i], "End_"+strArray[i]);&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&amp;nbsp;&amp;nbsp;System.out.println(ingestTbl); &lt;/B&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;JSONObject jsonObject = new JSONObject(ingestTbl);&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;String sourceRowCount=(jsonObject.getString("Source rows"));&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;String destinationRowCount=(jsonObject.getString("Destination rows"));&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;globalMap.put("source_row",sourceRowCount);&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;globalMap.put("destination_row",destinationRowCount.trim());&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;}&amp;nbsp;&amp;nbsp;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, in code &lt;B&gt;JSONObject jsonObject = new JSONObject(ingestTbl);, &lt;/B&gt;i received error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000SsrszAAB.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/142734iB5C67E43D14B4F1E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000SsrszAAB.png" alt="0695b00000SsrszAAB.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt; What should I do to loop the result from ingestTbl to &lt;B&gt;jsonObject &lt;/B&gt;so that I can bring the result for further process?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 07:50:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Iterate-the-result-from-tSYstem-in-tJava/m-p/2313858#M84676</guid>
      <dc:creator>WSyahirah21</dc:creator>
      <dc:date>2022-07-22T07:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: Iterate the result from tSYstem in tJava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Iterate-the-result-from-tSYstem-in-tJava/m-p/2313859#M84677</link>
      <description>&lt;P&gt;It is a compilation error,  output cannot be resolved to a variable in this line:&lt;/P&gt;&lt;P&gt;​String ingestTbl=StringUtils.substringBetween(output,"Ingestion Stats for Table "+strArray[i], "End_"+strArray[i]);&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why don't you use tWriteJsonField if you want to generate a Json string?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 08:07:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Iterate-the-result-from-tSYstem-in-tJava/m-p/2313859#M84677</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-22T08:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: Iterate the result from tSYstem in tJava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Iterate-the-result-from-tSYstem-in-tJava/m-p/2313860#M84678</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I dont think that issue come from that variable. as if I run that line itself, it outputs.&lt;/P&gt;&lt;P&gt;&lt;I&gt;table 1 {'Source rows': 818113, 'Destination rows': 548940} - &lt;/I&gt;for all table with respective result. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next step is to convert the string result to jsonObj and use globalMap to fetch the result. &lt;/P&gt;&lt;P&gt;From ingestTbl result, is there any way to use substringBetween? &lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 08:14:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Iterate-the-result-from-tSYstem-in-tJava/m-p/2313860#M84678</guid>
      <dc:creator>WSyahirah21</dc:creator>
      <dc:date>2022-07-22T08:14:54Z</dc:date>
    </item>
  </channel>
</rss>

