<?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: How to Denormalize a JSON source in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-Denormalize-a-JSON-source/m-p/2234814#M24042</link>
    <description>&lt;P&gt;Sorry, I didn't read your original post properly. But your key problem doesn't look too hard to solve. All you need is to pass a unique identifier to the looped rows. In your example above that could be the "value1" and "value2" fields for their respective loops. If they turn out to not be unique, you could actually use a sequence generated at the outer&amp;nbsp;level and provided to the inner level. Both work and I use them all the time when working with the Open Source product.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;With regard to your question as to why Talend do not provide a better mechanism, they do....with the Enterprise Edition. It is called Talend Data Mapper. But to be honest this provides its own issues in usage and documentation.&lt;/P&gt;</description>
    <pubDate>Tue, 30 May 2017 09:57:41 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-05-30T09:57:41Z</dc:date>
    <item>
      <title>How to Denormalize a JSON source</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-Denormalize-a-JSON-source/m-p/2234811#M24039</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I have a JSON source, with a lot of nested levels, and would have them flatted to denormalized rows.&lt;/P&gt; 
&lt;P&gt;Since&amp;nbsp;&lt;SPAN&gt;tExtractJSONFields permits me just to loop on an array field, I have to use more than one&amp;nbsp;tExtractJSONFields cascade, to loop on any nested array I have.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Any&amp;nbsp;tExtractJSONFields then will extract some fields that I don't know how to temporary store, to re-join them together in denormalized rows.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;From:&lt;/P&gt; 
&lt;P&gt;{"level1":[&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; {"value1":111,&amp;nbsp;"level2":[&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; {"value2":222,&amp;nbsp;"level3":[&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;SPAN&gt;"value3":"333-1"},&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/SPAN&gt;&lt;SPAN&gt;"value3":"333-2"}&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ]}&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp;]}&lt;/P&gt; 
&lt;P&gt;]&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;To (2 records):&lt;/P&gt; 
&lt;P&gt;111|222|"333-1"&lt;/P&gt; 
&lt;P&gt;111|222|"333-2"&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;My only idea, and I don't like it, is to use tHashOutput in the middle of the&amp;nbsp;&lt;SPAN&gt;tExtractJSONFields chain, between one and the next one, to fill 2 hash buffers (with "value1" and "value2") and make them available (by tHashInput) at the end of the chain, together with "value3" items.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Any better idea?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Regards,&lt;/P&gt; 
&lt;P&gt;Lorenzo&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2017 15:51:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-Denormalize-a-JSON-source/m-p/2234811#M24039</guid>
      <dc:creator>Lorenzo5</dc:creator>
      <dc:date>2017-05-29T15:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to Denormalize a JSON source</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-Denormalize-a-JSON-source/m-p/2234812#M24040</link>
      <description>&lt;P&gt;It sounds like you essentially have the right idea (using multiple&amp;nbsp;&lt;SPAN&gt;tExtractJSONFields). To store your temporary data you can use tHashOutput components and read it back in with tHashInput components. Remember that you will need to also output a "key" field for your looped data so that you can join it back.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2017 09:08:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-Denormalize-a-JSON-source/m-p/2234812#M24040</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-30T09:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to Denormalize a JSON source</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-Denormalize-a-JSON-source/m-p/2234813#M24041</link>
      <description>&lt;P&gt;... and Key is the (big) problem, now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have no any key at any level of the JSON structure, and I don't know how to generate it in the way that will be available to all tHashOutput, along the&amp;nbsp;&lt;SPAN&gt;tExtractJSONFields chain.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any idea?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(it's a pity that there is no any Talend component that convert a JSON structure in a multi-dimensional Java Hash. I should use a tJava component and write the code to convert... &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2017 09:44:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-Denormalize-a-JSON-source/m-p/2234813#M24041</guid>
      <dc:creator>Lorenzo5</dc:creator>
      <dc:date>2017-05-30T09:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to Denormalize a JSON source</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-Denormalize-a-JSON-source/m-p/2234814#M24042</link>
      <description>&lt;P&gt;Sorry, I didn't read your original post properly. But your key problem doesn't look too hard to solve. All you need is to pass a unique identifier to the looped rows. In your example above that could be the "value1" and "value2" fields for their respective loops. If they turn out to not be unique, you could actually use a sequence generated at the outer&amp;nbsp;level and provided to the inner level. Both work and I use them all the time when working with the Open Source product.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;With regard to your question as to why Talend do not provide a better mechanism, they do....with the Enterprise Edition. It is called Talend Data Mapper. But to be honest this provides its own issues in usage and documentation.&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2017 09:57:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-Denormalize-a-JSON-source/m-p/2234814#M24042</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-30T09:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to Denormalize a JSON source</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-Denormalize-a-JSON-source/m-p/2234815#M24043</link>
      <description>&lt;P&gt;How to pass a generated sequence through&amp;nbsp;&lt;SPAN&gt;tExtractJSONFields components? tExtractJSONFields does not permit to add any external field to the parsed result.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The sequence you mention has to be passed ahead through the chain, right?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2017 10:45:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-Denormalize-a-JSON-source/m-p/2234815#M24043</guid>
      <dc:creator>Lorenzo5</dc:creator>
      <dc:date>2017-05-30T10:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to Denormalize a JSON source</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-Denormalize-a-JSON-source/m-p/2234816#M24044</link>
      <description>&lt;P&gt;If you add a tmap between the&amp;nbsp;&lt;SPAN&gt;tExtractJSONFields components, you can manipulate your data that way. To pass a field "through" the&amp;nbsp;tExtractJSONFields component, just supply the column in the schema for the&amp;nbsp;tExtractJSONFields component, but do nothing with it in the component. The data you supply will be passed through untouched.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2017 11:26:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-Denormalize-a-JSON-source/m-p/2234816#M24044</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-30T11:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to Denormalize a JSON source</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-Denormalize-a-JSON-source/m-p/2234817#M24045</link>
      <description>&lt;P&gt;Oh, yes, I did not know that you can pass fields&amp;nbsp;through the JSON component.&lt;/P&gt; 
&lt;P&gt;But... the&amp;nbsp;&lt;SPAN&gt;tExtractJSONFields components run over nested loops, that mean the sequence should be generated in the most nested&amp;nbsp;loop (to be available in the last tHashOutput component) and propagated back to the previous loops (for tHashOutput components purpose).&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Consider three nested loops: the first loop with 2 items, the second one with 2 items, the third one with 3 items.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;We have to generate 12 key values. Where and how generate them and propagate them depending on all loops state?&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thank you,&lt;/P&gt; 
&lt;P&gt;Lorenzo&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2017 13:24:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-Denormalize-a-JSON-source/m-p/2234817#M24045</guid>
      <dc:creator>Lorenzo5</dc:creator>
      <dc:date>2017-05-30T13:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to Denormalize a JSON source</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-Denormalize-a-JSON-source/m-p/2234818#M24046</link>
      <description>&lt;P&gt;You can do this with the following (high level) structure....&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;tExtractJSONFields1 --&amp;gt; tMap --&amp;gt;&amp;nbsp;tExtractJSONFields --&amp;gt; tMap --&amp;gt;&amp;nbsp;tExtractJSONFields&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;As each row is released by the&amp;nbsp;tExtractJSONFields into the tMap components, a sequence number can be generated and passed "through" the&amp;nbsp;tExtractJSONFields component. These sequence numbers can then be used to identify related records.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;3 nested loops will require 3 sequences. While this might generate lots of actual ids, you only need to worry about the 3 sequences. Provide a column for each (e.g. key1, key2, key3) and then you are just matching like you would in any other scenario.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2017 13:54:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-Denormalize-a-JSON-source/m-p/2234818#M24046</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-30T13:54:45Z</dc:date>
    </item>
  </channel>
</rss>

