<?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: Create Fields using IterNo() in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Create-Fields-using-IterNo/m-p/528524#M691189</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, you can try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13793763487627811" jivemacro_uid="_13793763487627811"&gt;
&lt;P&gt;LOAD &lt;/P&gt;
&lt;P&gt;(IterNo() - 1) as Hour&lt;/P&gt;
&lt;P&gt;Autogenerate 1&lt;/P&gt;
&lt;P&gt;While IterNo() &amp;lt;=24;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards.&lt;/P&gt;&lt;P&gt;Tonial.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Sep 2013 00:07:56 GMT</pubDate>
    <dc:creator>fernando_tonial</dc:creator>
    <dc:date>2013-09-17T00:07:56Z</dc:date>
    <item>
      <title>Create Fields using IterNo()</title>
      <link>https://community.qlik.com/t5/QlikView/Create-Fields-using-IterNo/m-p/528523#M691188</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;I am trying to generate the hours of the day within the load script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET b = Chr(91)&amp;amp;'Hour '&amp;amp;Iterno()&amp;amp;Chr(93)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;( - 1 + IterNo()) as $(b)&lt;/P&gt;&lt;P&gt;While IterNo() &amp;lt;24;&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;Resident Table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is not giving me one record with 24 fields, but 24 records.&lt;/P&gt;&lt;P&gt;Can someone advise how to rectify this situation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Antoine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Sep 2013 16:02:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-Fields-using-IterNo/m-p/528523#M691188</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-09-16T16:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Create Fields using IterNo()</title>
      <link>https://community.qlik.com/t5/QlikView/Create-Fields-using-IterNo/m-p/528524#M691189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, you can try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13793763487627811" jivemacro_uid="_13793763487627811"&gt;
&lt;P&gt;LOAD &lt;/P&gt;
&lt;P&gt;(IterNo() - 1) as Hour&lt;/P&gt;
&lt;P&gt;Autogenerate 1&lt;/P&gt;
&lt;P&gt;While IterNo() &amp;lt;=24;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards.&lt;/P&gt;&lt;P&gt;Tonial.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Sep 2013 00:07:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-Fields-using-IterNo/m-p/528524#M691189</guid>
      <dc:creator>fernando_tonial</dc:creator>
      <dc:date>2013-09-17T00:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Create Fields using IterNo()</title>
      <link>https://community.qlik.com/t5/QlikView/Create-Fields-using-IterNo/m-p/528525#M691190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Antoine,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not quite sure if I understood your need exactly, but would this code snippet help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13793777946156290" jivemacro_uid="_13793777946156290"&gt;
&lt;P&gt;Table:&lt;/P&gt;
&lt;P&gt;LOAD * inline [&lt;/P&gt;
&lt;P&gt;value, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23&lt;/P&gt;
&lt;P&gt;hello world, 5, 4, 3, 2, 1, 5, 4, 3, 2, 1, 4, 3, 2, 1, 5, 6, 7, 8, 9, 4, 3, 2, 1, 1, 9&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LET b=Null();&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;FOR i=0 to 23&lt;/P&gt;
&lt;P&gt;&amp;nbsp; LET b = '$(b)' &amp;amp; If($(i)=0, '', ',') &amp;amp;'[$(i)] as [Hour $(i)]';&lt;/P&gt;
&lt;P&gt;NEXT i&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LOAD value, $(b);&lt;/P&gt;
&lt;P&gt;LOAD *&lt;/P&gt;
&lt;P&gt;Resident Table;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DROP Table Table;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You shall find attached a QVW file with the script, regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Philippe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Sep 2013 00:31:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-Fields-using-IterNo/m-p/528525#M691190</guid>
      <dc:creator>pgrenier</dc:creator>
      <dc:date>2013-09-17T00:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: Create Fields using IterNo()</title>
      <link>https://community.qlik.com/t5/QlikView/Create-Fields-using-IterNo/m-p/528526#M691192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Philippe, this solved it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Antoine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT:&lt;/P&gt;&lt;P&gt;I also managed&amp;nbsp; to reduce the number of steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET b=Null();&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;FOR i=0 to 23&lt;BR /&gt;&amp;nbsp;&amp;nbsp; LET b = '$(b)' &amp;amp; If($(i)=0, '', ',') &amp;amp;'$(i) as [Hour $(i)]';&lt;BR /&gt;NEXT i&lt;/P&gt;&lt;P&gt;FOR EACH b&lt;/P&gt;&lt;P&gt;[Table 2]:&lt;BR /&gt;LOAD &lt;BR /&gt; *,&lt;BR /&gt; $(b)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Resident [A previously Loaded Table 1]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Sep 2013 07:47:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-Fields-using-IterNo/m-p/528526#M691192</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-09-17T07:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: Create Fields using IterNo()</title>
      <link>https://community.qlik.com/t5/QlikView/Create-Fields-using-IterNo/m-p/528527#M691194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Tonial for your answer, this is not what I am looking for.&lt;/P&gt;&lt;P&gt;I was trying to create one record with 24 fields to represent the hours of the day.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Sep 2013 07:48:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-Fields-using-IterNo/m-p/528527#M691194</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-09-17T07:48:34Z</dc:date>
    </item>
  </channel>
</rss>

