<?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: Parsing JSON array based on values from another array in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Parsing-JSON-array-based-on-values-from-another-array/m-p/2250973#M35064</link>
    <description>&lt;P&gt;Hi Shong,&lt;BR /&gt;&lt;BR /&gt;That worked like a charm. Thanks !&lt;BR /&gt;&lt;BR /&gt;I was trying to do it with a tReplicate at first but it didn't let me join as a lookup. Can you please explain why it doesn't work when I'm using same tDBInput to replicate and then later on join?&lt;/P&gt;</description>
    <pubDate>Wed, 18 Mar 2020 16:40:46 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-03-18T16:40:46Z</dc:date>
    <item>
      <title>Parsing JSON array based on values from another array</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Parsing-JSON-array-based-on-values-from-another-array/m-p/2250970#M35061</link>
      <description>&lt;P&gt;Hello Community,&lt;BR /&gt;&lt;BR /&gt;So I have entire JSON data stored in DB. I am trying to Parse the following data:&lt;/P&gt; 
&lt;PRE&gt;[
  {
    "type": "ALO",
    "sessionInfo": {
      "test_id": 111,
      "test_type": 3
    },
    "data": {
      "id": 0,
      "name": "ABCDEF",
      "len": 4,
      "loopone": [
        {
          "id": 1,
          "name": "JKL",
          "ord": 23
        },
        {
          "id": 5,
          "name": "LMN",
          "ord": 24
        },
        {
          "id": 7,
          "name": "OPQ",
          "ord": 25
        },
        {
          "id": 8,
          "name": "RST",
          "ord": 26
        }        
      ],
      "looptwo": [
        {
          "id": 1,
          "name": "ZZ1",
          "start_id": 1,
          "end_id": 5
        },
        {
          "id": 2,
          "name": "ZZ2",
          "len": 15207,
          "start_id": 5,
          "end_id": 7
        }
      ]
    }
  }
]&lt;/PRE&gt; 
&lt;P&gt;&lt;BR /&gt;What I have done currently is use a tDBInput -&amp;gt; tExtractJSONField1 with Loop Jsonpath Query set to "$", this extracts the type, sessionInfo and Data objects for me.&lt;BR /&gt;&lt;BR /&gt;tExtractJSONField2 is looping over "$.data.loopone[*]" which extracts all fields from loopone&lt;BR /&gt;&lt;BR /&gt;Now i am facing issue in tExtractJSONField3. In array "Looptwo", the "start_id" object represents "id" from "loopone". Since there are only two values present for "start_id" (1,5 for loopone ID), what I want is to show NULL for id "8" and get a total of 4 records as output, having null for values not present in looptwo. At the moment, I am getting 8 rows in output with "start_id" repeating.&lt;BR /&gt;&lt;BR /&gt;Would appreciate if someone can give immediate response on this. Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 02:58:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Parsing-JSON-array-based-on-values-from-another-array/m-p/2250970#M35061</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T02:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing JSON array based on values from another array</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Parsing-JSON-array-based-on-values-from-another-array/m-p/2250971#M35062</link>
      <description>&lt;P&gt;bump &lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MADq.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/146464i525272F95B61C2BD/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MADq.png" alt="0683p000009MADq.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2020 10:07:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Parsing-JSON-array-based-on-values-from-another-array/m-p/2250971#M35062</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-17T10:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing JSON array based on values from another array</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Parsing-JSON-array-based-on-values-from-another-array/m-p/2250972#M35063</link>
      <description>Hi OmarAmjad 
&lt;BR /&gt;My opinion is to extract data from array Looptwo first, and stored them to memory (tHashOutput) for used later. 
&lt;BR /&gt;Next, extract data from array Loopone, and do inner join or left outer join with the data from Looptwo, filter the data if needed. 
&lt;BR /&gt; 
&lt;BR /&gt;Regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Wed, 18 Mar 2020 03:48:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Parsing-JSON-array-based-on-values-from-another-array/m-p/2250972#M35063</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-18T03:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing JSON array based on values from another array</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Parsing-JSON-array-based-on-values-from-another-array/m-p/2250973#M35064</link>
      <description>&lt;P&gt;Hi Shong,&lt;BR /&gt;&lt;BR /&gt;That worked like a charm. Thanks !&lt;BR /&gt;&lt;BR /&gt;I was trying to do it with a tReplicate at first but it didn't let me join as a lookup. Can you please explain why it doesn't work when I'm using same tDBInput to replicate and then later on join?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 16:40:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Parsing-JSON-array-based-on-values-from-another-array/m-p/2250973#M35064</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-18T16:40:46Z</dc:date>
    </item>
  </channel>
</rss>

