<?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 Where put data table name in do while function in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Where-put-data-table-name-in-do-while-function/m-p/1662284#M49729</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have the next script but when I refresh I'm not able to create the table name so in the concat function I got the error in the final image.&lt;/P&gt;&lt;P&gt;Where should I put the name? Or should I use a function to do so?&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF00FF"&gt;Let vNumeroPagina=1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;do while vValorFinal&amp;gt;2&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;[VentasDiarias]:&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;Período&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;FROM [XXXXX]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;(html, codepage is 1252, embedded labels, table is @$(vNumeroPagina));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#FF00FF"&gt;Let vValorFinal=len(peek('Período',-2,'VentasDiarias'));&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF00FF"&gt;Let vNumeroPagina=$(vNumeroPagina)+1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;Loop&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Concatenate (VentasDiarias)&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;Período&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;FROM [xxxxxxx]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;(ooxml, embedded labels, table is Sheet1);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;Drop Table;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Captura de Pantalla 2020-01-02 a la(s) 7.56.11 p.&amp;nbsp;m..png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/26307iAC857E6828DFF570/image-size/large?v=v2&amp;amp;px=999" role="button" title="Captura de Pantalla 2020-01-02 a la(s) 7.56.11 p.&amp;nbsp;m..png" alt="Captura de Pantalla 2020-01-02 a la(s) 7.56.11 p.&amp;nbsp;m..png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 19:21:48 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T19:21:48Z</dc:date>
    <item>
      <title>Where put data table name in do while function</title>
      <link>https://community.qlik.com/t5/App-Development/Where-put-data-table-name-in-do-while-function/m-p/1662284#M49729</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have the next script but when I refresh I'm not able to create the table name so in the concat function I got the error in the final image.&lt;/P&gt;&lt;P&gt;Where should I put the name? Or should I use a function to do so?&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF00FF"&gt;Let vNumeroPagina=1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;do while vValorFinal&amp;gt;2&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;[VentasDiarias]:&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;Período&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;FROM [XXXXX]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;(html, codepage is 1252, embedded labels, table is @$(vNumeroPagina));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#FF00FF"&gt;Let vValorFinal=len(peek('Período',-2,'VentasDiarias'));&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF00FF"&gt;Let vNumeroPagina=$(vNumeroPagina)+1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;Loop&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Concatenate (VentasDiarias)&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;Período&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;FROM [xxxxxxx]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;(ooxml, embedded labels, table is Sheet1);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;Drop Table;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Captura de Pantalla 2020-01-02 a la(s) 7.56.11 p.&amp;nbsp;m..png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/26307iAC857E6828DFF570/image-size/large?v=v2&amp;amp;px=999" role="button" title="Captura de Pantalla 2020-01-02 a la(s) 7.56.11 p.&amp;nbsp;m..png" alt="Captura de Pantalla 2020-01-02 a la(s) 7.56.11 p.&amp;nbsp;m..png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 19:21:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Where-put-data-table-name-in-do-while-function/m-p/1662284#M49729</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T19:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: Where put data table name in do while function</title>
      <link>https://community.qlik.com/t5/App-Development/Where-put-data-table-name-in-do-while-function/m-p/1662286#M49730</link>
      <description>&lt;P&gt;I feel on the first run the initial table is not created or loaded with zero records before the concatenation statement is executed , could you please share the complete log file ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2020 02:17:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Where-put-data-table-name-in-do-while-function/m-p/1662286#M49730</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2020-01-03T02:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Where put data table name in do while function</title>
      <link>https://community.qlik.com/t5/App-Development/Where-put-data-table-name-in-do-while-function/m-p/1662684#M49804</link>
      <description>&lt;P&gt;My guess is that it is not going into the loop at all as you are not initialising vValorFinal and it is not getting set until inside the loop.&lt;/P&gt;&lt;P&gt;Ahead of the code you have, try adding:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;let vValorFinal = 9999;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If you have a load and you are not sure whether a table exists before you concatenate to it you can always create a dummy table:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MyTable:&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; null() as tmpDummy&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;AUTOGENERATE(1);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Then at the end:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DROP FIELD tmpDummy;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;This should create a table stub that can then be concatenated to. It's a bit of a cheat, but it works.&lt;/P&gt;&lt;P&gt;A neater, but fiddlier, alternative is to do the table name in a variable:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;let vTabName = if(alt(NoOfRows('MyTable'), 0) &amp;gt; 0, 'CONCATENATE (MyTable)', 'MyTable:');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;$(vTabName)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp;... etc ...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Sun, 05 Jan 2020 15:57:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Where-put-data-table-name-in-do-while-function/m-p/1662684#M49804</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2020-01-05T15:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Where put data table name in do while function</title>
      <link>https://community.qlik.com/t5/App-Development/Where-put-data-table-name-in-do-while-function/m-p/1663821#M49909</link>
      <description>&lt;P&gt;The drop field worked perfectly&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2020 19:41:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Where-put-data-table-name-in-do-while-function/m-p/1663821#M49909</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-08T19:41:18Z</dc:date>
    </item>
  </channel>
</rss>

