<?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: question on using a for loop structure to create fields in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/question-on-using-a-for-loop-structure-to-create-fields/m-p/762473#M661732</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you be more specific about "&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333330154419px;"&gt;It does not like the concatenation that I've used.". Script error? Unexpected results?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What are you trying to do with?&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #339966;"&gt;&amp;nbsp; autogenerate(1) where RecNo() &amp;lt;0;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #339966;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;That will generate zero rows Same as &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Autogenerate 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;-Rob&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #339966;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Feb 2015 18:38:12 GMT</pubDate>
    <dc:creator>rwunderlich</dc:creator>
    <dc:date>2015-02-06T18:38:12Z</dc:date>
    <item>
      <title>question on using a for loop structure to create fields</title>
      <link>https://community.qlik.com/t5/QlikView/question-on-using-a-for-loop-structure-to-create-fields/m-p/762472#M661731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using the Hierarchy function to create a hierarchy tree structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to fix the node depth to 15.&amp;nbsp; I'm using the below for loop to do this, but does not work.&lt;/P&gt;&lt;P&gt;The leaf nodes get generated as Location1, Location2, etc.&lt;/P&gt;&lt;P&gt;My logic is as follows for my loop:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop through my fields, say if the leaf ends at 7, use the for loop to generate fields [8-15]&lt;/P&gt;&lt;P&gt;I seem to be having a problem with this statement:&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #ff0000; font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;If FieldNumber('Location'$(v_level),’TMP_FRY14A’) = 0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;It does not like the concatenation that I've used.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Any help appreciated !&lt;BR /&gt;&lt;/SPAN&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;[TMP_FRY14A]:&lt;/P&gt;&lt;P&gt;Hierarchy(ChildID, ParentID, Location, ParentLocation, Location, Path, \, NodeDepth)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;load&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NODE_ID as ChildID,&lt;/P&gt;&lt;P&gt;PARENT_ID as ParentID,&lt;/P&gt;&lt;P&gt;NAME as Location,&lt;/P&gt;&lt;P&gt;IS_LEAF,&lt;/P&gt;&lt;P&gt;PRIORITY,&lt;/P&gt;&lt;P&gt;IS_DEFAULT,&lt;/P&gt;&lt;P&gt;HIERARCHY_CATEGORY,&lt;/P&gt;&lt;P&gt;HIERARCHY_NAME&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM [$(Parameters_Path_Qvd_Data)\FRY14A.qvd](qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #339966;"&gt;For v_level1 = 1 to 15&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;&lt;STRONG&gt;&amp;nbsp; If FieldNumber('Location'$(v_level),’TMP_FRY14A’) = 0 then&amp;nbsp; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For v_level2 = $v_level1 to 15&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; concatenate (TMP_FRY14A)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Load &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; null() as Location$(v_level2)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; autogenerate(1) where RecNo() &amp;lt;0;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #339966;"&gt;Next&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 18:25:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/question-on-using-a-for-loop-structure-to-create-fields/m-p/762472#M661731</guid>
      <dc:creator>gerrycastellino</dc:creator>
      <dc:date>2015-02-06T18:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: question on using a for loop structure to create fields</title>
      <link>https://community.qlik.com/t5/QlikView/question-on-using-a-for-loop-structure-to-create-fields/m-p/762473#M661732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you be more specific about "&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333330154419px;"&gt;It does not like the concatenation that I've used.". Script error? Unexpected results?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What are you trying to do with?&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #339966;"&gt;&amp;nbsp; autogenerate(1) where RecNo() &amp;lt;0;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #339966;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;That will generate zero rows Same as &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Autogenerate 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;-Rob&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #339966;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 18:38:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/question-on-using-a-for-loop-structure-to-create-fields/m-p/762473#M661732</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2015-02-06T18:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: question on using a for loop structure to create fields</title>
      <link>https://community.qlik.com/t5/QlikView/question-on-using-a-for-loop-structure-to-create-fields/m-p/762474#M661734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm getting the foll. error in the log:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2015/02/06 10:28:41: 0037&amp;nbsp;&amp;nbsp;&amp;nbsp; If FieldNumber('Location',’TMP_FRY14A’) = 0 then&lt;/P&gt;&lt;P&gt;2015/02/06 10:28:41:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; General Script Error&lt;/P&gt;&lt;P&gt;2015/02/06 10:28:41:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Execution Failed&lt;/P&gt;&lt;P&gt;2015/02/06 10:28:41:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Execution finished.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'd like the construct to do is test for the existence of a field via my v_level expansion&amp;nbsp; loop.&lt;/P&gt;&lt;P&gt;In effect I'd like the line to read like:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;****&amp;nbsp; If FieldNumber('Location7',’TMP_FRY14A’) = 0 then ****&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #339966;"&gt; autogenerate(1) where RecNo() &amp;lt;0;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I just wanted to create blank columns in my table,&amp;nbsp; I came across the code above.&lt;/P&gt;&lt;P&gt;It works when I do it as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;elseif FieldNumber('Location7','TMP_FRY14A') = 0 then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; concatenate (TMP_FRY14A)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Load &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; null() as Location7,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; null() as Location8,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; null() as Location9,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; null() as Location10,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; null() as Location11,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; null() as Location12,&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; null() as Location13,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; null() as Location14,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; null() as Location15 &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; autogenerate(1) where RecNo() &amp;lt;0;&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;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 21:03:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/question-on-using-a-for-loop-structure-to-create-fields/m-p/762474#M661734</guid>
      <dc:creator>gerrycastellino</dc:creator>
      <dc:date>2015-02-06T21:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: question on using a for loop structure to create fields</title>
      <link>https://community.qlik.com/t5/QlikView/question-on-using-a-for-loop-structure-to-create-fields/m-p/762475#M661739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the general script error is because you have backticks, instead of single quotes, around your table name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the loop can be simplified to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;For v_level = 1 to 15&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;If FieldNumber('Location$(v_level)','TMP_FRY14A') = 0 then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; concatenate (TMP_FRY14A)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; Load null() as Location$(v_level)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; autogenerate 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;ENDIF&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Next&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com" rel="nofollow"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://robwunderlich.com" rel="nofollow"&gt;http://robwunderlich.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 23:27:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/question-on-using-a-for-loop-structure-to-create-fields/m-p/762475#M661739</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2015-02-06T23:27:16Z</dc:date>
    </item>
  </channel>
</rss>

