<?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 Loading a non well formed CSV file in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Loading-a-non-well-formed-CSV-file/m-p/169690#M40406</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Give it a try with a script like the below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;xPhoneBill:&lt;BR /&gt; LOAD&lt;BR /&gt; IF(Mode = 'AS ABOVE',&lt;BR /&gt; PEEK('Mode'), Mode) AS Mode,&lt;BR /&gt; SUBFIELD(Line, ',', 1) AS Date,&lt;BR /&gt; SUBFIELD(Line, ',', 2) AS Time,&lt;BR /&gt; SUBFIELD(Line, ',', 3) AS Category,&lt;BR /&gt; REPLACE(SUBFIELD(Line, ',', 4), CHR(39), '') AS Name,&lt;BR /&gt; SUBFIELD(Line, ',', 5) AS Units,&lt;BR /&gt; REPLACE(SUBFIELD(Line, ',', 6), '"', '') AS Duration,&lt;BR /&gt; SUBFIELD(Line, ',', 7) AS InvCost,&lt;BR /&gt; SUBFIELD(Line, ',', &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; AS BaseCost&lt;BR /&gt; WHERE&lt;BR /&gt; NOT WILDMATCH(Line, '*SUBTOTAL*', 'DATE*', '');&lt;BR /&gt; LOAD&lt;BR /&gt; IF(WILDMATCH(Line, 'Local*', 'SMS*'),&lt;BR /&gt; Line, 'AS ABOVE') AS Mode,&lt;BR /&gt; Line;&lt;BR /&gt; LOAD&lt;BR /&gt; @1:n AS Line&lt;BR /&gt; FROM&lt;BR /&gt; [.\PhoneBill.txt] (ansi, fix, embedded labels, no labels, record is line);&lt;BR /&gt;&lt;BR /&gt;PhoneBill:&lt;BR /&gt; NOCONCATENATE LOAD * RESIDENT xPhoneBill WHERE LEN(Time) &amp;gt; 0;&lt;BR /&gt; DROP TABLE PhoneBill;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Have not managed in the same loading to eliminate the blank rows (i.e. where Time is not shown), therefore the changing of the tables.&lt;/P&gt;&lt;P&gt;HTH&lt;BR /&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Dec 2009 18:03:00 GMT</pubDate>
    <dc:creator>prieper</dc:creator>
    <dc:date>2009-12-01T18:03:00Z</dc:date>
    <item>
      <title>Loading a non well formed CSV file</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-a-non-well-formed-CSV-file/m-p/169689#M40405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an extract of call records from my cellphone provider in the following format. How would I go about loading this data in a table, I would ideally like to have the Local/National or SMS repeated per applicable data line as a category. Any help would be appreciated.&lt;/P&gt;&lt;P&gt;Local/National&lt;BR /&gt;Date,Time,Category,Name,Units,Duration,Inv Cost,Base Cost&lt;BR /&gt;22/04/2008,15:42:53,,'5555555555',234.0,"00:03:54",0.00,5.81&lt;BR /&gt;25/04/2008,15:38:30,,'5555555555',79.0,"00:01:19",0.00,1.96&lt;BR /&gt;30/04/2008,02:19:13,,'5555555555',57.0,"00:00:57",0.00,0.83&lt;BR /&gt;09/05/2008,10:11:34,,'5555555555',281.0,"00:04:41",0.00,6.98&lt;BR /&gt;09/05/2008,10:29:09,,'5555555555',27.0,"00:00:27",0.00,0.67&lt;BR /&gt;09/05/2008,11:23:59,,'5555555555',259.0,"00:04:19",0.00,6.43&lt;BR /&gt;09/05/2008,12:13:10,,'5555555555',11.0,"00:00:11",0.00,0.27&lt;BR /&gt;09/05/2008,12:19:58,,'5555555555',107.0,"00:01:47",0.00,2.66&lt;BR /&gt;10/05/2008,11:10:16,,'5555555555',107.0,"00:01:47",0.00,1.55&lt;BR /&gt;,,,Subtotals: ,1162.0,0:19:22,0.00,27.16&lt;/P&gt;&lt;P&gt;SMS&lt;BR /&gt;Date,Time,Category,Name,Units,Duration,Inv Cost,Base Cost&lt;BR /&gt;21/04/2008,07:11:13,,'5555555555',.0,"00:00:00",0.66,0.66&lt;BR /&gt;22/04/2008,16:28:05,,'5555555555',.0,"00:00:00",0.66,0.66&lt;BR /&gt;27/04/2008,21:49:58,,'5555555555',.0,"00:00:00",0.66,0.66&lt;BR /&gt;09/05/2008,12:19:21,,'5555555555',.0,"00:00:00",0.66,0.66&lt;BR /&gt;09/05/2008,16:30:45,,'5555555555',.0,"00:00:00",0.66,0.66&lt;BR /&gt;09/05/2008,18:36:46,,'5555555555',.0,"00:00:00",0.66,0.66&lt;BR /&gt;,,,Subtotals: ,0.0,0:00:00,3.96,3.96&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Dec 2009 04:46:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-a-non-well-formed-CSV-file/m-p/169689#M40405</guid>
      <dc:creator />
      <dc:date>2009-12-01T04:46:46Z</dc:date>
    </item>
    <item>
      <title>Loading a non well formed CSV file</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-a-non-well-formed-CSV-file/m-p/169690#M40406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Give it a try with a script like the below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;xPhoneBill:&lt;BR /&gt; LOAD&lt;BR /&gt; IF(Mode = 'AS ABOVE',&lt;BR /&gt; PEEK('Mode'), Mode) AS Mode,&lt;BR /&gt; SUBFIELD(Line, ',', 1) AS Date,&lt;BR /&gt; SUBFIELD(Line, ',', 2) AS Time,&lt;BR /&gt; SUBFIELD(Line, ',', 3) AS Category,&lt;BR /&gt; REPLACE(SUBFIELD(Line, ',', 4), CHR(39), '') AS Name,&lt;BR /&gt; SUBFIELD(Line, ',', 5) AS Units,&lt;BR /&gt; REPLACE(SUBFIELD(Line, ',', 6), '"', '') AS Duration,&lt;BR /&gt; SUBFIELD(Line, ',', 7) AS InvCost,&lt;BR /&gt; SUBFIELD(Line, ',', &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; AS BaseCost&lt;BR /&gt; WHERE&lt;BR /&gt; NOT WILDMATCH(Line, '*SUBTOTAL*', 'DATE*', '');&lt;BR /&gt; LOAD&lt;BR /&gt; IF(WILDMATCH(Line, 'Local*', 'SMS*'),&lt;BR /&gt; Line, 'AS ABOVE') AS Mode,&lt;BR /&gt; Line;&lt;BR /&gt; LOAD&lt;BR /&gt; @1:n AS Line&lt;BR /&gt; FROM&lt;BR /&gt; [.\PhoneBill.txt] (ansi, fix, embedded labels, no labels, record is line);&lt;BR /&gt;&lt;BR /&gt;PhoneBill:&lt;BR /&gt; NOCONCATENATE LOAD * RESIDENT xPhoneBill WHERE LEN(Time) &amp;gt; 0;&lt;BR /&gt; DROP TABLE PhoneBill;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Have not managed in the same loading to eliminate the blank rows (i.e. where Time is not shown), therefore the changing of the tables.&lt;/P&gt;&lt;P&gt;HTH&lt;BR /&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Dec 2009 18:03:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-a-non-well-formed-CSV-file/m-p/169690#M40406</guid>
      <dc:creator>prieper</dc:creator>
      <dc:date>2009-12-01T18:03:00Z</dc:date>
    </item>
  </channel>
</rss>

