<?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: Loading from source where duplicate field names exist in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Loading-from-source-where-duplicate-field-names-exist/m-p/1331805#M837811</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while you are taking CSV file you can cancel the second field .Remove second field from here just like click &lt;STRONG&gt;X&lt;/STRONG&gt; symbol here(which field is not having data). so that it will give only first field.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Image result for load excel data qlikview" class="jive-image" src="http://qlikanddirty.com/wp-content/uploads/2016/08/excel_import_1.jpg" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 May 2017 07:58:48 GMT</pubDate>
    <dc:creator>ramasaisaksoft</dc:creator>
    <dc:date>2017-05-12T07:58:48Z</dc:date>
    <item>
      <title>Loading from source where duplicate field names exist</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-from-source-where-duplicate-field-names-exist/m-p/1331804#M837810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to load data from a CSV file - this file has 2 fields with the same name: "Business Owner".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I only need to load one of them, but it's a specific one - the first one in the file, however, when I have the field name in my load script it for some reason automatically picks up the second column (which contains no data).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way to tell QV in the load script that it must load the first instance of the duplicate field names?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that I do NOT want to edit the CSV file to change or delete the duplicate - I need to resolve this in the load script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-from-source-where-duplicate-field-names-exist/m-p/1331804#M837810</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Loading from source where duplicate field names exist</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-from-source-where-duplicate-field-names-exist/m-p/1331805#M837811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while you are taking CSV file you can cancel the second field .Remove second field from here just like click &lt;STRONG&gt;X&lt;/STRONG&gt; symbol here(which field is not having data). so that it will give only first field.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Image result for load excel data qlikview" class="jive-image" src="http://qlikanddirty.com/wp-content/uploads/2016/08/excel_import_1.jpg" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 May 2017 07:58:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-from-source-where-duplicate-field-names-exist/m-p/1331805#M837811</guid>
      <dc:creator>ramasaisaksoft</dc:creator>
      <dc:date>2017-05-12T07:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: Loading from source where duplicate field names exist</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-from-source-where-duplicate-field-names-exist/m-p/1331806#M837812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That doesn't work - all that does is create the script for you, and it will still create the script with the "Business Owner" as the field name - it's no different that typing out the load script. It still loads the wrong field - even if it did work, I am reloading the same script multiple times daily (CSV gets updated) so cannot go through the load wizard each time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 May 2017 08:05:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-from-source-where-duplicate-field-names-exist/m-p/1331806#M837812</guid>
      <dc:creator>gerhardl</dc:creator>
      <dc:date>2017-05-12T08:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: Loading from source where duplicate field names exist</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-from-source-where-duplicate-field-names-exist/m-p/1331807#M837813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;AFAIK if this happened within an excel-file the fields with identically field-names will get an automatic counter by loading the data per file-wizard and with them you could identify and/or remove them. But this won't work with a text-file. I think the only way will be to load the file without labels and then to rename them per AS statement or per mapping: &lt;A href="https://community.qlik.com/qlik-blogpost/2763"&gt;How to Rename Fields&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 May 2017 08:26:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-from-source-where-duplicate-field-names-exist/m-p/1331807#M837813</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2017-05-12T08:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: Loading from source where duplicate field names exist</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-from-source-where-duplicate-field-names-exist/m-p/1660907#M837814</link>
      <description>&lt;P&gt;It's multi-step process.&amp;nbsp; (I have attached the &lt;SPAN&gt;QVF)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;He is my Default Load script (fails):&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Tic&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;kets:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;LOAD&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Ticket,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Sprint,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Sprint,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Sprint,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"Story Points",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Assignee,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Assignee,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"Component/s",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"Component/s"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;FROM [lib://AttachedFiles/Duplicate Columns Example.csv]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;(txt, codepage is 285&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;91, embedded labels, delimiter is ',', msq);&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I opted for Concatenating the Columns with duplicate field names and then using SubField() to get the proper output in the final table&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial black,avant garde"&gt;1) get the column names&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;ColumnNames:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;first 1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;LOAD&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;@1,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;@2,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;@3,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;@4,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;@5,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;@6,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;@7,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;@8,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;@9&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;FROM [lib://AttachedFiles/Duplicate Columns Example.csv]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;(txt, codepage is 28591, no labels, delimiter is ',', msq);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial black,avant garde"&gt;2)&amp;nbsp;&amp;nbsp;&amp;nbsp;Narrow down the table to Unique fields and concatenate the ColumnNums into unique Column names&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;let x=NoOfFields('ColumnNames');&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;trace '-----[' $(x) ']-----';&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;for i=1 to $(x);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;let j=$(i)+2;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ColumnNames2:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;load &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;$(i) as ColumnNum,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;'['&amp;amp;@$(i)&amp;amp;']' as ColumnName&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;resident ColumnNames;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;next;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Col3:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NoConcatenate&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;load distinct *,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;if (Peek('ColumnName') = ColumnName,Peek('ColumnLoad') &amp;amp; '&amp;amp;chr(10) &amp;amp; @' &amp;amp; ColumnNum, '@' &amp;amp; ColumnNum) as ColumnLoad&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Resident ColumnNames2;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;drop table ColumnNames2;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;// Remove the Columns that only concatenate some of the values&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;filter:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;inner keep load&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ColumnName,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;max(ColumnNum) as ColumnNum&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;resident Col3&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;group by ColumnName;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;drop table filter;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial black,avant garde"&gt;3)Get each script line individually&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Final1:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NoConcatenate&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Load&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;'Unique Name' as ColumnName,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ColumnLoad &amp;amp;' as ' &amp;amp; ColumnName&amp;amp;',' as LoadScriptLine&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Resident Col3;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Drop table Col3;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial black,avant garde"&gt;4)&amp;nbsp;Consolidate the Columns into one line of script&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Final:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NoConcatenate&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Load &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Concat(LoadScriptLine,chr(10)) as lines&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Resident Final1&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Group By ColumnName;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Drop table [Final1];&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT face="arial black,avant garde"&gt;5) Coalesce&amp;nbsp;the Table load script here, then execute it&lt;/FONT&gt;&lt;BR /&gt;// Note: If you use something other comma for delimiting you won't see the highlighting error. This still loads&lt;BR /&gt;let FullScript=&lt;BR /&gt;'tickets:'&amp;amp; chr(10) &amp;amp;&lt;BR /&gt;'NoConcatenate '&amp;amp; chr(10) &amp;amp;&lt;BR /&gt;'load '&amp;amp; left(FieldValue('lines','1'),len(FieldValue('lines','1'))-1) &amp;amp; chr(10) &amp;amp;&lt;BR /&gt;'FROM [lib://AttachedFiles/Duplicate Columns Example.csv]'&amp;amp; chr(10) &amp;amp;&lt;BR /&gt;'(txt, utf8, no labels, delimiter is '','', msq,header is 1 lines);';&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial black,avant garde"&gt;6) Break out the Duplicate fields&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;trace $(FullScript);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;$(FullScript);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Drop table [Final];&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial black,avant garde"&gt;7) Coalesce&amp;nbsp;the table w/Concat values&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;FinalTickets:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;NoConcatenate&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;LOAD&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Ticket,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;subfield(Sprint,chr(10)) as Sprint,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;subfield("Story Points",chr(10)) as "Story Points",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;subfield(Assignee,chr(10)) as Assignee,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;subfield([Component/s],chr(10)) as [Component/s]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Resident tickets;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial black,avant garde"&gt;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; cleanup&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Drop tables [tickets],ColumnNames;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2019 23:56:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-from-source-where-duplicate-field-names-exist/m-p/1660907#M837814</guid>
      <dc:creator>morganstake</dc:creator>
      <dc:date>2019-12-26T23:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: Loading from source where duplicate field names exist</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-from-source-where-duplicate-field-names-exist/m-p/1951060#M1219736</link>
      <description>&lt;P&gt;Thanks a lot&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/94908"&gt;@morganstake&lt;/a&gt;&amp;nbsp;for the script.This worked perfectly. &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jul 2022 19:20:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-from-source-where-duplicate-field-names-exist/m-p/1951060#M1219736</guid>
      <dc:creator>dandaanilreddy</dc:creator>
      <dc:date>2022-07-03T19:20:18Z</dc:date>
    </item>
  </channel>
</rss>

