<?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 retrieve information from .txt to variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-retrieve-information-from-txt-to-variable/m-p/641348#M1090632</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class="Mu SP" style="font-family: arial, sans-serif; font-size: 13.513513565063477px; margin-bottom: 6px; color: #262626;"&gt;&lt;SPAN style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;Hi , i have a file (.txt ) , and i want to load the information in it into a variable . The structure of this file is : &lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;201403&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;P class="Mu SP" style="font-family: arial, sans-serif; font-size: 13.513513565063477px; margin-bottom: 6px; color: #262626;"&gt;&lt;SPAN style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;201305&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;...&lt;/DIV&gt;&lt;DIV&gt;what i want to do is to load into two variables one for the month and one for the year &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;how can i do this , if you need more information to help me , tell me and i'll explain more &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;Thank you&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 May 2014 09:28:01 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-05-21T09:28:01Z</dc:date>
    <item>
      <title>How to retrieve information from .txt to variable</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-retrieve-information-from-txt-to-variable/m-p/641348#M1090632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class="Mu SP" style="font-family: arial, sans-serif; font-size: 13.513513565063477px; margin-bottom: 6px; color: #262626;"&gt;&lt;SPAN style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;Hi , i have a file (.txt ) , and i want to load the information in it into a variable . The structure of this file is : &lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;201403&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;P class="Mu SP" style="font-family: arial, sans-serif; font-size: 13.513513565063477px; margin-bottom: 6px; color: #262626;"&gt;&lt;SPAN style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;201305&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;...&lt;/DIV&gt;&lt;DIV&gt;what i want to do is to load into two variables one for the month and one for the year &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;how can i do this , if you need more information to help me , tell me and i'll explain more &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;Thank you&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2014 09:28:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-retrieve-information-from-txt-to-variable/m-p/641348#M1090632</guid>
      <dc:creator />
      <dc:date>2014-05-21T09:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve information from .txt to variable</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-retrieve-information-from-txt-to-variable/m-p/641349#M1090633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kamy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please use the code below. Remember to put a field name (Variables in the exaple) into the first row of your text file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;text file structure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Variables&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201403&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201405&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Qlikview script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Variables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD Variables FROM c:\file.txt (txt, utf8, embedded labels, delimiter is '\t', msq); //here all the file rows are readed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LET Variable1 = peek( 'Variables', 0 ); //0 is the first row&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LET Variable2 = peek( 'Variables', 1 ); //1 is the second row&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If you need a lot of variables do a loop and use an incremental variable into the second parameter instead a number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2014 09:44:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-retrieve-information-from-txt-to-variable/m-p/641349#M1090633</guid>
      <dc:creator />
      <dc:date>2014-05-21T09:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve information from .txt to variable</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-retrieve-information-from-txt-to-variable/m-p/641350#M1090635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; that's correct , please i need to know if i can do like this : &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;peek( 'Variables', 0 )&amp;lt;=9, //here I want to concatenate the variable with zero)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for exemple :&amp;nbsp; if the value is 3 it should become 03&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thks for your help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2014 10:09:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-retrieve-information-from-txt-to-variable/m-p/641350#M1090635</guid>
      <dc:creator />
      <dc:date>2014-05-21T10:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve information from .txt to variable</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-retrieve-information-from-txt-to-variable/m-p/641351#M1090637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kamy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; No, you can't do it directly with the PEEK sentence but using a conditional will work (if you need to do a loop it will&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; work too):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Variables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD Variables FROM c:\file.txt (txt, utf8, embedded labels, delimiter is '\t', msq);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LET Variable1 = peek( 'Variables', 0 ); //0 is the first row&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LET Variable2 = peek( 'Variables', 1 ); //1 is the second row&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF $(Variable1) &amp;lt;=9 THEN&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LET Variable1 = 0 &amp;amp; $(Variable1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENDIF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Let me know if this works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2014 10:24:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-retrieve-information-from-txt-to-variable/m-p/641351#M1090637</guid>
      <dc:creator />
      <dc:date>2014-05-21T10:24:12Z</dc:date>
    </item>
  </channel>
</rss>

