<?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: For...Do While - For $(Var) = 1 error in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/For-Do-While-For-Var-1-error/m-p/581783#M216103</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Ahh, the generic load.&amp;nbsp; I'd heard of this but never looked into it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That was indeed a timely load.&amp;nbsp; Many thanks for your helps Gysbert.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Apr 2014 08:30:57 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-04-01T08:30:57Z</dc:date>
    <item>
      <title>For...Do While - For $(Var) = 1 error</title>
      <link>https://community.qlik.com/t5/QlikView/For-Do-While-For-Var-1-error/m-p/581776#M216096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 8pt;"&gt;Hi&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 8pt;"&gt;I am trying to create a loop which basically looks at the different values in a table (FieldName) and creates a field in another table for each of the values it finds.&amp;nbsp; I am simply using a Peek feature to look up the field value in the original table which populates a variable.&amp;nbsp; This variable then sets the name of the field in the following load.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 8pt;"&gt;However, I cannot get the "For Fieldno" to work it keeps complaining of an error.&amp;nbsp;&amp;nbsp; Even when I force the Fieldno variable to be 1, the Let Fieldno = $(Fieldno) + 1 value does not&amp;nbsp; return a value from the field variable peek (there are 27 fields in total).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 8pt;"&gt;Can any one help?&amp;nbsp; Attached below is my code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;Let&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;fieldcount&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Peek&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('FieldCount',-1, 'ComplaintsAreas');&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;//Let&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;Fieldno&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 1;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;for Fieldno = 1 &lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;Do&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;while&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(Fieldno)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;lt;= &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(fieldcount)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;Let&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;field&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Peek&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('FieldName', '$(Fieldno)' , 'ComplaintsAreas');&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;Trace&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; '$(FieldName)';&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;Trace&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; '$(FieldNo)';&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ComplaintsOnly:&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;Load&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DataID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;strValue&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(field)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Resident&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; Complaints &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;FieldName&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = '$(field)';&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;Let&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;Fieldno&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(Fieldno)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; + 1;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;loop &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2014 15:12:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-Do-While-For-Var-1-error/m-p/581776#M216096</guid>
      <dc:creator />
      <dc:date>2014-03-31T15:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: For...Do While - For $(Var) = 1 error</title>
      <link>https://community.qlik.com/t5/QlikView/For-Do-While-For-Var-1-error/m-p/581777#M216097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you're using a for loop, you need to include a to and a next.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P class="Code"&gt;&lt;STRONG&gt;FOR&lt;/STRONG&gt; a=1 &lt;STRONG&gt;to&lt;/STRONG&gt; 9&lt;/P&gt;
&lt;P class="Code"&gt;LOAD * FROM file$(a).csv;&lt;/P&gt;
&lt;P class="Code"&gt;&lt;STRONG&gt;NEXT&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2014 15:38:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-Do-While-For-Var-1-error/m-p/581777#M216097</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2014-03-31T15:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: For...Do While - For $(Var) = 1 error</title>
      <link>https://community.qlik.com/t5/QlikView/For-Do-While-For-Var-1-error/m-p/581778#M216098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you explain what the purpose of it all is (for the end user interacting with the data)? I have the feeling that there probably is an easier way to achieve that result. If you could also post some sample data that would be helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2014 15:52:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-Do-While-For-Var-1-error/m-p/581778#M216098</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-03-31T15:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: Re: For...Do While - For $(Var) = 1 error</title>
      <link>https://community.qlik.com/t5/QlikView/For-Do-While-For-Var-1-error/m-p/581779#M216099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I switched to use the For...Next functionality but with no joy.&lt;/P&gt;&lt;P&gt;I have attached an example, I am trying to create a new field for each value within a field.&amp;nbsp; i.e. if I have a field called data type and one value was Department, one value city etc.&amp;nbsp; I'd want a table with those values as fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2014 16:15:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-Do-While-For-Var-1-error/m-p/581779#M216099</guid>
      <dc:creator />
      <dc:date>2014-03-31T16:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: For...Do While - For $(Var) = 1 error</title>
      <link>https://community.qlik.com/t5/QlikView/For-Do-While-For-Var-1-error/m-p/581780#M216100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The question is still... why? What is the purpose? Why do you want a table like that? Why is a pivot table unsuitable?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you say you want seems to be what a generic load does:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generic&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Company, DataType, Data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CoA, Department, Sales&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CoA, Department, Marketing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CoA, Department, Accounting&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CoA, City, Durham&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CoA, City, York&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CoA, City, Leeds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CoA, Salesperson, Dave&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CoA, Salesperson, Gemma&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CoA, Salesperson, Sonia&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2014 16:34:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-Do-While-For-Var-1-error/m-p/581780#M216100</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-03-31T16:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: For...Do While - For $(Var) = 1 error</title>
      <link>https://community.qlik.com/t5/QlikView/For-Do-While-For-Var-1-error/m-p/581781#M216101</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;Thanks for your input so far.&amp;nbsp; Let me clarify with a more meaningful example (attached). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, I have a table with three fields.&amp;nbsp; One is the ID of the data (or person in the example), the second field is the type of data (e.g. their name or email address etc.) and the third field is the actual data (e.g. Steve or &lt;A href="mailto:steve@hotmail.com"&gt;steve@hotmail.com&lt;/A&gt; etc).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want from the attached table is a field for the ID (which I already have) and a field for Surname, a field for First Name, a field for email address and&amp;nbsp; a field for Postcode, thus I have 5 fields instead of 3.&amp;nbsp; I guess it's like a reverse of a Crosstable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have included an example of what I'm trying to do in the model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe I'm missing something obvious.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help/assistance in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2014 06:46:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-Do-While-For-Var-1-error/m-p/581781#M216101</guid>
      <dc:creator />
      <dc:date>2014-04-01T06:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: For...Do While - For $(Var) = 1 error</title>
      <link>https://community.qlik.com/t5/QlikView/For-Do-While-For-Var-1-error/m-p/581782#M216102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yup, sounds like you want a generic load like I posted above. See this (amazingly timed) blog post from &lt;A href="https://community.qlik.com/qlik-users/4003"&gt;Henric Cronström&lt;/A&gt;: &lt;A _jive_internal="true" class="font-color-normal" href="https://community.qlik.com/blogs/qlikviewdesignblog/2014/03/31/generic" style="font-style: inherit; font-family: inherit; color: #3d3d3d;"&gt;The Generic Load&lt;/A&gt;. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2014 07:38:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-Do-While-For-Var-1-error/m-p/581782#M216102</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-04-01T07:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: For...Do While - For $(Var) = 1 error</title>
      <link>https://community.qlik.com/t5/QlikView/For-Do-While-For-Var-1-error/m-p/581783#M216103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Ahh, the generic load.&amp;nbsp; I'd heard of this but never looked into it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That was indeed a timely load.&amp;nbsp; Many thanks for your helps Gysbert.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2014 08:30:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/For-Do-While-For-Var-1-error/m-p/581783#M216103</guid>
      <dc:creator />
      <dc:date>2014-04-01T08:30:57Z</dc:date>
    </item>
  </channel>
</rss>

