<?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 How to combine columns data file into full data file automatically and import it to qlikview? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-combine-columns-data-file-into-full-data-file/m-p/1267596#M854004</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;Hi,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;i am practicing to build different dashboards and i came across this data &lt;A data-saferedirecturl="https://www.google.com/url?hl=en&amp;amp;q=https://www-odi.nhtsa.dot.gov/downloads/&amp;amp;source=gmail&amp;amp;ust=1488135703366000&amp;amp;usg=AFQjCNE00EKDZ7wOxoV4MN9JuHWGwWf4EQ" href="https://www-odi.nhtsa.dot.gov/downloads/" style="color: #1155cc; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" target="_blank" title="https://www-odi.nhtsa.dot.gov/downloads/"&gt;Office of Defects Investigation (ODI), Flat File Downloads | Safercar.gov | NHTSA&lt;/A&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp; and the columns are in one text file and data is in another file, delimiter specified is 'tab'. so, i copied the columns from text file into note pad and gave tab delimiter to them and copied into the file where data exits and then used to import to qlikview and build data models.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;But, my question is if i have like 50 tables and so. then should i copy the data like that manually for all the tables or is there any automatic way which does the job? are there any options in qlikview or something? can some one please help?&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Regards,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Veer &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator />
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>How to combine columns data file into full data file automatically and import it to qlikview?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-combine-columns-data-file-into-full-data-file/m-p/1267596#M854004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;Hi,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;i am practicing to build different dashboards and i came across this data &lt;A data-saferedirecturl="https://www.google.com/url?hl=en&amp;amp;q=https://www-odi.nhtsa.dot.gov/downloads/&amp;amp;source=gmail&amp;amp;ust=1488135703366000&amp;amp;usg=AFQjCNE00EKDZ7wOxoV4MN9JuHWGwWf4EQ" href="https://www-odi.nhtsa.dot.gov/downloads/" style="color: #1155cc; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;" target="_blank" title="https://www-odi.nhtsa.dot.gov/downloads/"&gt;Office of Defects Investigation (ODI), Flat File Downloads | Safercar.gov | NHTSA&lt;/A&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp; and the columns are in one text file and data is in another file, delimiter specified is 'tab'. so, i copied the columns from text file into note pad and gave tab delimiter to them and copied into the file where data exits and then used to import to qlikview and build data models.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;But, my question is if i have like 50 tables and so. then should i copy the data like that manually for all the tables or is there any automatic way which does the job? are there any options in qlikview or something? can some one please help?&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Regards,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Veer &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/How-to-combine-columns-data-file-into-full-data-file/m-p/1267596#M854004</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine columns data file into full data file automatically and import it to qlikview?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-combine-columns-data-file-into-full-data-file/m-p/1267597#M854005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Splitting the headers off from the data and then hiding them in a descriptive text file without fixed formatting is a highly irregular way of formatting a data source, and very software unfriendly at that too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AFAIK QlikView wizards don't have builtin functionality to handle this kind of formatting, but you may be able to create a script to do it for you. It all starts with these steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Finding combinations of data files and descriptions. Like a &lt;SPAN style="font-family: 'courier new', courier;"&gt;FLAT_INV.txt&lt;/SPAN&gt; (data) and &lt;SPAN style="font-family: 'courier new', courier;"&gt;INV.txt&lt;/SPAN&gt; (description). The common part is &lt;SPAN style="font-family: 'courier new', courier;"&gt;INV&lt;/SPAN&gt;. Put that identifier in a variable (for example &lt;SPAN style="font-family: 'courier new', courier;"&gt;vTableName&lt;/SPAN&gt;)&lt;/LI&gt;&lt;LI&gt;First read the description file, and try to lift the series of column specifications from it. You may want to look for a line that starts with exactly 6 hyphen characters. Then you read rows as long as you encounter digits or whitespace at the start of every line.&lt;/LI&gt;&lt;LI&gt;When you have a series of column headers, create a text representation of the column aliassing instructions to be used in a LOAD statement and put the representation in a variable. For example, &lt;SPAN style="font-family: 'courier new', courier;"&gt;vColumnSpecs&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;Then perform this statement:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;[$(vTableName)]:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD $(vColumnSpecs) FROM [&lt;EM&gt;path&lt;/EM&gt;\FLAT_$(vTableName).txt] (&lt;EM&gt;options&lt;/EM&gt;);&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;and repeat this for all files in a specific subdirectory identified by path.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just some ideas to help you get started.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2017 11:13:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-combine-columns-data-file-into-full-data-file/m-p/1267597#M854005</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2017-02-27T11:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine columns data file into full data file automatically and import it to qlikview?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-combine-columns-data-file-into-full-data-file/m-p/1267598#M854006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looking at the files it could be tricky as the header files have differing header lines etc...&lt;/P&gt;&lt;P&gt;I'm going to take a look at writing this script though as I like a challenge &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2017 11:44:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-combine-columns-data-file-into-full-data-file/m-p/1267598#M854006</guid>
      <dc:creator>adamdavi3s</dc:creator>
      <dc:date>2017-02-27T11:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine columns data file into full data file automatically and import it to qlikview?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-combine-columns-data-file-into-full-data-file/m-p/1267599#M854007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was fun, note that this is no means infallible and I only tested it with two of the files on the link you provided, but it should give you a good starting point (I hope)&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14882025856113336" jivemacro_uid="_14882025856113336"&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//loop through and load our meta files&lt;/P&gt;
&lt;P&gt;//assumes they are txt files without an _ in the name&lt;/P&gt;
&lt;P&gt;//note have used fixed file import which isn't totally accurate&lt;/P&gt;
&lt;P&gt;//but seems to be the closest we can get&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;FOR Each File in filelist ('*.txt');&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;IF wildmatch('$(File)','*_*') =0 THEN&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Files: &lt;/P&gt;
&lt;P&gt;LOAD &lt;/P&gt;
&lt;P&gt;&amp;nbsp; replace(subfield('$(File)','\',SubStringCount('$(File)','\')+1),'.txt','') as filename,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; [@1:6], &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [@7:30], &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [@31:88], &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [@89:n]&lt;/P&gt;
&lt;P&gt;FROM&lt;/P&gt;
&lt;P&gt;[$(File)](fix, codepage is 1252, no labels);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;END IF&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;NEXT File&lt;/P&gt;
&lt;P&gt;//purge anything which isn't a valid column&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Columns:&lt;/P&gt;
&lt;P&gt;LOAD filename,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [@7:30] as columnno, &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; subfield([@31:88],'&amp;nbsp;&amp;nbsp; ',1) as columndesc&lt;/P&gt;
&lt;P&gt;RESIDENT Files&lt;/P&gt;
&lt;P&gt;WHERE isnum([@7:30]);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DROP TABLE Files; //drop temp table&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LET v_number_files = FieldValueCount('filename'); //find how many files to load&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;FOR f=1 to $(v_number_files) //start a loop for the files&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; LET v_filename = FieldValue('filename',$(f)); //find the corresponding filename&lt;/P&gt;
&lt;P&gt;&amp;nbsp; QUALIFY *; //qualify as we don't want to have issues with the same field names&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; '$(v_filename)':&lt;/P&gt;
&lt;P&gt;&amp;nbsp; LOAD *&lt;/P&gt;
&lt;P&gt;&amp;nbsp; FROM&lt;/P&gt;
&lt;P&gt;&amp;nbsp; [FLAT_$(v_filename).txt]&lt;/P&gt;
&lt;P&gt;&amp;nbsp; (txt, codepage is 1252, no labels, delimiter is '\t', msq);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; UNQUALIFY *; //unqualify&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; //load our column names&lt;/P&gt;
&lt;P&gt;&amp;nbsp; tablecolumns:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; LOAD DISTINCT columnno as tblcolumno,columndesc as tblcolumndesc&lt;/P&gt;
&lt;P&gt;&amp;nbsp; RESIDENT Columns&lt;/P&gt;
&lt;P&gt;&amp;nbsp; WHERE filename='$(v_filename)';&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; LET v_number_columns = FieldValueCount('tblcolumno'); //how many fields are there in the file&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; FOR i=1 to&amp;nbsp; $(v_number_columns)&amp;nbsp; //for each of these figure out our rename&lt;/P&gt;
&lt;P&gt;&amp;nbsp; LET v_fieldno = $(i);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; LET v_fielddesc = FieldValue('columndesc',$(i));&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; rename field '$(v_filename).@$(v_fieldno)' to '$(v_filename).$(v_fielddesc)';&lt;/P&gt;
&lt;P&gt;&amp;nbsp; NEXT i; //next field&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; drop table tablecolumns;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;NEXT f; //next file&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Drop table Columns;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2017 13:36:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-combine-columns-data-file-into-full-data-file/m-p/1267599#M854007</guid>
      <dc:creator>adamdavi3s</dc:creator>
      <dc:date>2017-02-27T13:36:37Z</dc:date>
    </item>
  </channel>
</rss>

