<?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: CSV embedded in JSON in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/CSV-embedded-in-JSON/m-p/1350102#M616309</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I get one of those CSV-formatted strings in the JSON record for each invoice, detailing the lines in the invoice. I'd like to end up with a table with Invoice ID (which I can get from the header just fine) and then kind, description, quantity etc as fields. It'd be easy if it was in files, but it's being embedded in JSON that makes it tricky.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Aug 2017 09:15:06 GMT</pubDate>
    <dc:creator>AlexOmetis</dc:creator>
    <dc:date>2017-08-04T09:15:06Z</dc:date>
    <item>
      <title>CSV embedded in JSON</title>
      <link>https://community.qlik.com/t5/QlikView/CSV-embedded-in-JSON/m-p/1350100#M616307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm extracting data from the Harvest API. I've got plenty of data out of it, but am struggling with the strange format they output Invoice Lines... it's CSV embedded within JSON or XML - which is a new one on me. This part of the API is documented &lt;A href="http://help.getharvest.com/api-v1/invoices-api/invoices/show-invoices/"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So how do you turn this value in a JSON response:&lt;/P&gt;&lt;P&gt;&lt;CODE class="language-json" data-lang="json" style="font-size: 0.9rem; background: transparent; color: #444444;"&gt;&lt;SPAN class="s2" style="color: #dd1144;"&gt;kind,description,quantity,unit_price,amount,taxed,taxed2,project_id\nProduct,A description,1.00,100.00,100.0,false,false,\n&lt;/SPAN&gt;&lt;SPAN class="w" style="color: #bbbbbb;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/CODE&gt;into something that Qlik can analyse properly? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Initially I thought it would be fine - just subfield on newline (chr(10)) and then again on comma, but the usual things catch you out - newlines and commas within the data. If there's no new line or comma in a field, it doesn't wrap the contents in quotes, but if there is, it does. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I thought perhaps I could store it out to a file and read it back in as a CSV file, but of course Qlik adds its own quotes around things and additional header row when you save to CSV/TXT so that doesn't help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course I could call an external program to do the processing, but I wondered if anyone had a way of doing this within Qlik. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Aug 2017 21:07:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/CSV-embedded-in-JSON/m-p/1350100#M616307</guid>
      <dc:creator>AlexOmetis</dc:creator>
      <dc:date>2017-08-03T21:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: CSV embedded in JSON</title>
      <link>https://community.qlik.com/t5/QlikView/CSV-embedded-in-JSON/m-p/1350101#M616308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got 90% which you explained. Still doubt what you are trying? And can i know simple way to do in Qlik where you are expecting&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Aug 2017 01:35:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/CSV-embedded-in-JSON/m-p/1350101#M616308</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-08-04T01:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: CSV embedded in JSON</title>
      <link>https://community.qlik.com/t5/QlikView/CSV-embedded-in-JSON/m-p/1350102#M616309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I get one of those CSV-formatted strings in the JSON record for each invoice, detailing the lines in the invoice. I'd like to end up with a table with Invoice ID (which I can get from the header just fine) and then kind, description, quantity etc as fields. It'd be easy if it was in files, but it's being embedded in JSON that makes it tricky.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Aug 2017 09:15:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/CSV-embedded-in-JSON/m-p/1350102#M616309</guid>
      <dc:creator>AlexOmetis</dc:creator>
      <dc:date>2017-08-04T09:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: CSV embedded in JSON</title>
      <link>https://community.qlik.com/t5/QlikView/CSV-embedded-in-JSON/m-p/1350103#M616310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can load the JSON with a regular LOAD and afterwards you can LOAD ..... FROMFIELD .... from the field that has the CSV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you provide a sample JSON-file with some CSV embedded and I can give you a working example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Aug 2017 18:41:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/CSV-embedded-in-JSON/m-p/1350103#M616310</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2017-08-12T18:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: CSV embedded in JSON</title>
      <link>https://community.qlik.com/t5/QlikView/CSV-embedded-in-JSON/m-p/1350104#M616311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fantastic - had never come across that before, but that's sorted it - thanks very much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Although worth noting it's FROM_FIELD not just FROMFIELD)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Aug 2017 08:41:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/CSV-embedded-in-JSON/m-p/1350104#M616311</guid>
      <dc:creator>AlexOmetis</dc:creator>
      <dc:date>2017-08-14T08:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: CSV embedded in JSON</title>
      <link>https://community.qlik.com/t5/QlikView/CSV-embedded-in-JSON/m-p/1350105#M616312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems to be very slow though... Haven't used it on very large amounts of data but the experience so far is that it is *slow* - the FROM_FIELD loading not JSON.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Aug 2017 09:03:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/CSV-embedded-in-JSON/m-p/1350105#M616312</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2017-08-14T09:03:03Z</dc:date>
    </item>
  </channel>
</rss>

