<?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: Best practices for splitting complex json in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Best-practices-for-splitting-complex-json/m-p/2250956#M35053</link>
    <description>&lt;P&gt;This post might give you a few ideas&lt;/P&gt; 
&lt;P&gt;&lt;A href="https://community.qlik.com/s/feed/0D73p000004kXvZCAU#M93081" target="_blank"&gt;https://community.talend.com/t5/Design-and-Development/downloading-JSON-in-structured-format/m-p/152303/highlight/true#M93081&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Mar 2019 00:02:13 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-03-14T00:02:13Z</dc:date>
    <item>
      <title>Best practices for splitting complex json</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Best-practices-for-splitting-complex-json/m-p/2250955#M35052</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt; 
&lt;P&gt;i'm pretty new in talend and imported my first JSON. The problem is that this file is very complex and I don't know exactly how to read it right.&lt;/P&gt; 
&lt;P&gt;Let me give you an example:&lt;/P&gt; 
&lt;PRE&gt;  "data": [
    {
      "EANCode": "1234567",
      "Info": {
        "active": true,
        "articleID": 1234,
        "articleKey": "1234",
      },
      "attributes": [
        {
          "Key": "date",
          "Value": "2011-11-11"
        },
        {
          "Key": "color",
          "Value": "red"
        },
        {
          "Key": "Key@Aufmachung",
          "Value": "A12    @01"
        },
        {
          "Key": "Key@TkgNr",
          "Value": "A1@123"
        }
      ],
      "b2csku": "12345678&lt;/PRE&gt; 
&lt;P&gt;It's a huge file, around 22k lines, ~500 per item.&amp;nbsp;My biggest problem is the value in "Key" and "Value"&amp;nbsp;and the fact that they always contain different amounts of information&amp;nbsp;which is why I can't 'hardcode' it.&amp;nbsp;My current approach is a simple string manipulation to extract the key value values.&amp;nbsp;My idea was to cut off the first characters in tmap, but I don't think the approach is very successful either. It also doesn't help me with the variable amount of data in "attributes". Do you have any tips or ideas for me?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Best regards,&lt;/P&gt; 
&lt;P&gt;BooWseR&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2019 07:15:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Best-practices-for-splitting-complex-json/m-p/2250955#M35052</guid>
      <dc:creator>BooWseR</dc:creator>
      <dc:date>2019-03-13T07:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: Best practices for splitting complex json</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Best-practices-for-splitting-complex-json/m-p/2250956#M35053</link>
      <description>&lt;P&gt;This post might give you a few ideas&lt;/P&gt; 
&lt;P&gt;&lt;A href="https://community.qlik.com/s/feed/0D73p000004kXvZCAU#M93081" target="_blank"&gt;https://community.talend.com/t5/Design-and-Development/downloading-JSON-in-structured-format/m-p/152303/highlight/true#M93081&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2019 00:02:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Best-practices-for-splitting-complex-json/m-p/2250956#M35053</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-14T00:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Best practices for splitting complex json</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Best-practices-for-splitting-complex-json/m-p/2250957#M35054</link>
      <description>&lt;P&gt;Thanks for your answer. I have now iterated the JSON in several runs.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="iterate.PNG" style="width: 166px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M3xO.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/149416i761028D64052B3E2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M3xO.png" alt="0683p000009M3xO.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;This works quite well so far, but now I have problems merging the data into columns.&amp;nbsp;For example, I use tMap to write the values into my own columns:&lt;/P&gt; 
&lt;P&gt;(data.attributes.Key.equals("date")) ? data.attributes.Value : null --&amp;gt; date&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Now my output looks like:&lt;/P&gt; 
&lt;TABLE&gt; 
 &lt;TBODY&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;EAN&lt;/TD&gt; 
   &lt;TD&gt;date&lt;/TD&gt; 
   &lt;TD&gt;color&lt;/TD&gt; 
   &lt;TD&gt;Key@Aufmachung&lt;/TD&gt; 
   &lt;TD&gt;Key@TkgNr&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;1234567&lt;/TD&gt; 
   &lt;TD&gt;2011-11-11&lt;/TD&gt; 
   &lt;TD&gt;null&lt;/TD&gt; 
   &lt;TD&gt;null&lt;/TD&gt; 
   &lt;TD&gt;null&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;1234567&lt;/TD&gt; 
   &lt;TD&gt;null&lt;/TD&gt; 
   &lt;TD&gt;red&lt;/TD&gt; 
   &lt;TD&gt;null&lt;/TD&gt; 
   &lt;TD&gt;null&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;1234567&lt;/TD&gt; 
   &lt;TD&gt;null&lt;/TD&gt; 
   &lt;TD&gt;null&lt;/TD&gt; 
   &lt;TD&gt;A12 @01&lt;/TD&gt; 
   &lt;TD&gt;null&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;1234567&lt;/TD&gt; 
   &lt;TD&gt;null&lt;/TD&gt; 
   &lt;TD&gt;null&lt;/TD&gt; 
   &lt;TD&gt;null&lt;/TD&gt; 
   &lt;TD&gt;A1@123&lt;/TD&gt; 
  &lt;/TR&gt; 
 &lt;/TBODY&gt; 
&lt;/TABLE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I would now like to merge the rows, but I have no idea how. I tried tDenormalize and select all columns except EAN, but it doesnt effect my output. I also tried&amp;nbsp;tmemorizeRows, but even without success.&amp;nbsp;What am I doing wrong?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 04:15:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Best-practices-for-splitting-complex-json/m-p/2250957#M35054</guid>
      <dc:creator>BooWseR</dc:creator>
      <dc:date>2019-03-26T04:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: Best practices for splitting complex json</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Best-practices-for-splitting-complex-json/m-p/2250958#M35055</link>
      <description>&lt;P&gt;A simple way to do this (if you know that there is one row per EAN) is to use the tAggregateRow component. Group by the EAN column and output the other columns using the "first" function and tick the "Ignore null values" tickbox.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 09:22:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Best-practices-for-splitting-complex-json/m-p/2250958#M35055</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-26T09:22:33Z</dc:date>
    </item>
  </channel>
</rss>

