<?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: Scripting - use a variable in field names in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Scripting-use-a-variable-in-field-names/m-p/1000609#M647046</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Marco. Cross-table works perfectly (well, in my case, since I have values and quantities, I need to do it in two steps, which is a little bit cumbersome, but it works).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I´m curious why below code fails (my values are stored in fields [Val/COArea Crcy 001] where 001 stands for the month and goes from 001 to 016)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;this is what the debugger shows me as interpreted values of the variables &lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Val/COArea Crcy 001 &amp;lt;NULL&amp;gt;&lt;BR /&gt; counter 01 &lt;/P&gt;&lt;P&gt;// &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;this is the script code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;&lt;STRONG&gt;Set&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 10pt;"&gt;counter&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;=01;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 10pt;"&gt;Do&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;while&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;counter&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &amp;lt; 17;&lt;BR /&gt; &lt;BR /&gt; Postings:&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 10pt;"&gt;load&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Object number]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Fiscal Year]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Value Type]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;Version&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Cost Element]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[CO subkey]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;Bus.Transaction&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 10pt;"&gt;// [Trading Partner], &lt;BR /&gt; // [Trdg part.BA], &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Dr/Cr indicator]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Trans. Currency]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Period block]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Unit of Measure]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Debit type]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; (&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 10pt;"&gt;$(counter)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp; &amp;gt; 9, '0' &amp;amp; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 10pt;"&gt;$(counter)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;, '00' &amp;amp; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 10pt;"&gt;$(counter)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Month (Long)]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 10pt;"&gt;$(Val/COArea Crcy 0$(counter))&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;Value&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;resident&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; PostingsTemp2;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 10pt;"&gt;Let&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 10pt;"&gt;counter&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;counter&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; +1;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 10pt;"&gt;Loop&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 10pt;"&gt;drop&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;tables&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; PostingsTemp2; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Nov 2015 09:04:28 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-11-03T09:04:28Z</dc:date>
    <item>
      <title>Scripting - use a variable in field names</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-use-a-variable-in-field-names/m-p/1000604#M647041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good afternoon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table MyTable like&lt;/P&gt;&lt;P&gt;Company&lt;/P&gt;&lt;P&gt;CostCenter&lt;/P&gt;&lt;P&gt;Year&lt;/P&gt;&lt;P&gt;Amount001 (where the '001' stands for Jan&lt;/P&gt;&lt;P&gt;Amount002&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;Amount016&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and would like to convert it to&lt;/P&gt;&lt;P&gt;Company&lt;/P&gt;&lt;P&gt;CostCenter&lt;/P&gt;&lt;P&gt;Year&lt;/P&gt;&lt;P&gt;Month&lt;/P&gt;&lt;P&gt;Amount&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to use a variable and loop over the table, but Qlik apparently does not recognize the row highlighted below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;&lt;STRONG&gt;Set&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 10pt;"&gt;counter&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;= 1;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 10pt;"&gt;Do&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;while&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;counter&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &amp;lt; 17;&lt;BR /&gt;&amp;nbsp; Postings:&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 10pt;"&gt;load &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Company&lt;/P&gt;&lt;P&gt;CostCenter&lt;/P&gt;&lt;P&gt;Year&lt;/P&gt;&lt;P&gt;Amount($counter) as Amount&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // this row is my problem&lt;/P&gt;&lt;P&gt;($counter) as Month&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;L.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Oct 2015 17:11:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-use-a-variable-in-field-names/m-p/1000604#M647041</guid>
      <dc:creator />
      <dc:date>2015-10-30T17:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting - use a variable in field names</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-use-a-variable-in-field-names/m-p/1000605#M647042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use CROSSTABLE LOAD&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/3628"&gt;The Crosstable Load&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;, something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CROSSTABLE (Month, Amount, 3)&lt;/P&gt;&lt;P&gt;LOAD Company, CostCenter, Year, Amount001, Amount002&lt;/P&gt;&lt;P&gt;FROM ...;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then map your fieldnames:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MAP:&lt;/P&gt;&lt;P&gt;MAPPING LOAD F1, F2 INLINE [&lt;/P&gt;&lt;P&gt;F1, F2&lt;/P&gt;&lt;P&gt;Amount001, Jan&lt;/P&gt;&lt;P&gt;Amount002, Feb&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RESULT:&lt;/P&gt;&lt;P&gt;NOCONCATENATE&lt;/P&gt;&lt;P&gt;LOAD Company, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CostCenter, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; applymap('MAP', Month) as Month,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Amount&lt;/P&gt;&lt;P&gt;RESIDENT CROSS;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE CROSS;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Oct 2015 17:21:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-use-a-variable-in-field-names/m-p/1000605#M647042</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-10-30T17:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting - use a variable in field names</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-use-a-variable-in-field-names/m-p/1000606#M647043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You start with the Crosstable function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TempPostings:&lt;/P&gt;&lt;P&gt;Crosstable(TempMonth,Value,3)&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Company,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CostCenter,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Amount001,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Amount002,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Amount016&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM ...&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Then you need to replace the 'AmountXXX' values in the TempMonth field with Jan, Feb etc. You could use a mapping table for this:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;MapMonth:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Mapping LOAD * INLINE [&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Name, NewName&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Amount001, Jan&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Amount002, Feb&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;...etc&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;];&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;You can then use the mapping table in the applymap function:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Postings:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD *, ApplyMap('MapMonth',TempMonth) as Month&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Resident TempPostings;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Drop Table TempPostings;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Drop Field TempMonth;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Oct 2015 17:23:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-use-a-variable-in-field-names/m-p/1000606#M647043</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-10-30T17:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting - use a variable in field names</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-use-a-variable-in-field-names/m-p/1000607#M647044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;besides CrossTable being the function you're looking for, your script would work using this syntax:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set counter= 1;&lt;/P&gt;&lt;P&gt;Do while counter &amp;lt;= 3;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Postings:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;ID,&lt;/P&gt;&lt;P&gt;Amount&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;$(counter)&lt;/STRONG&gt;&lt;/SPAN&gt; as Amount,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-size: 13.3333px;"&gt;&lt;STRONG&gt;$(counter)&lt;/STRONG&gt;&lt;/SPAN&gt; as Month&lt;/P&gt;&lt;P&gt;Resident table1;&lt;/P&gt;&lt;P&gt;counter=counter+1;&lt;/P&gt;&lt;P&gt;LOOP;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2015 00:01:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-use-a-variable-in-field-names/m-p/1000607#M647044</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2015-11-02T00:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting - use a variable in field names</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-use-a-variable-in-field-names/m-p/1000608#M647045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks! Works well!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Nov 2015 08:55:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-use-a-variable-in-field-names/m-p/1000608#M647045</guid>
      <dc:creator />
      <dc:date>2015-11-03T08:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting - use a variable in field names</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-use-a-variable-in-field-names/m-p/1000609#M647046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Marco. Cross-table works perfectly (well, in my case, since I have values and quantities, I need to do it in two steps, which is a little bit cumbersome, but it works).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I´m curious why below code fails (my values are stored in fields [Val/COArea Crcy 001] where 001 stands for the month and goes from 001 to 016)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;this is what the debugger shows me as interpreted values of the variables &lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Val/COArea Crcy 001 &amp;lt;NULL&amp;gt;&lt;BR /&gt; counter 01 &lt;/P&gt;&lt;P&gt;// &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;this is the script code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;&lt;STRONG&gt;Set&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 10pt;"&gt;counter&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;=01;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 10pt;"&gt;Do&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;while&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;counter&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &amp;lt; 17;&lt;BR /&gt; &lt;BR /&gt; Postings:&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 10pt;"&gt;load&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Object number]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Fiscal Year]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Value Type]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;Version&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Cost Element]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[CO subkey]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;Bus.Transaction&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 10pt;"&gt;// [Trading Partner], &lt;BR /&gt; // [Trdg part.BA], &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Dr/Cr indicator]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Trans. Currency]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Period block]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Unit of Measure]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Debit type]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; (&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 10pt;"&gt;$(counter)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp; &amp;gt; 9, '0' &amp;amp; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 10pt;"&gt;$(counter)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;, '00' &amp;amp; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 10pt;"&gt;$(counter)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;[Month (Long)]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 10pt;"&gt;$(Val/COArea Crcy 0$(counter))&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;Value&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;resident&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; PostingsTemp2;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 10pt;"&gt;Let&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 10pt;"&gt;counter&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;counter&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; +1;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 10pt;"&gt;Loop&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 10pt;"&gt;drop&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;tables&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; PostingsTemp2; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Nov 2015 09:04:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-use-a-variable-in-field-names/m-p/1000609#M647046</guid>
      <dc:creator />
      <dc:date>2015-11-03T09:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting - use a variable in field names</title>
      <link>https://community.qlik.com/t5/QlikView/Scripting-use-a-variable-in-field-names/m-p/1000610#M647047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This variable is not set correctly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;Val/COArea Crcy 001 &amp;lt;NULL&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to check the code before the while loop, where you define the variable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Nov 2015 10:34:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Scripting-use-a-variable-in-field-names/m-p/1000610#M647047</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-11-03T10:34:56Z</dc:date>
    </item>
  </channel>
</rss>

