<?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: sub function script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/sub-function-script/m-p/1411789#M426867</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Viresh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code is as you stated, storing the provided vTableName into the QVD only if there's fields to it with the statement&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;let vNoFields = NoOfFields('$(vTableName)');&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;This will check how many fields ("headers" with no data count as well) the table has.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;As an example, the following&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;x:&lt;/P&gt;&lt;P&gt;load * Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;A,B&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let a = NoOfFields('x');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lets 'a' with the value 2, even though there's no data in the table and so if i called the sub it would store the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Felipe.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Aug 2017 13:11:30 GMT</pubDate>
    <dc:creator>felipedl</dc:creator>
    <dc:date>2017-08-16T13:11:30Z</dc:date>
    <item>
      <title>sub function script</title>
      <link>https://community.qlik.com/t5/QlikView/sub-function-script/m-p/1411788#M426866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could anyone please explain the below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub StoreAndDrop(vTableName,vQvdFile)&lt;/P&gt;&lt;P&gt;let vNoFields = NoOfFields('$(vTableName)');&lt;/P&gt;&lt;P&gt;if Len('$(vNoFields)') &amp;gt; 0 Then&lt;/P&gt;&lt;P&gt;Store [$(vTableName)] into [$(vQvdFile)];&lt;/P&gt;&lt;P&gt;Drop Table [$(vTableName)];&lt;/P&gt;&lt;P&gt;Else&lt;/P&gt;&lt;P&gt;Trace ** Cannot Store - $(vTableName) does not exist.;&lt;/P&gt;&lt;P&gt;End if&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per my understanding, a sub procedure is created to&amp;nbsp; store the table into a qvd file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Viresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Aug 2017 12:56:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sub-function-script/m-p/1411788#M426866</guid>
      <dc:creator>vireshkolagimat</dc:creator>
      <dc:date>2017-08-16T12:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: sub function script</title>
      <link>https://community.qlik.com/t5/QlikView/sub-function-script/m-p/1411789#M426867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Viresh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code is as you stated, storing the provided vTableName into the QVD only if there's fields to it with the statement&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;let vNoFields = NoOfFields('$(vTableName)');&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;This will check how many fields ("headers" with no data count as well) the table has.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;As an example, the following&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;x:&lt;/P&gt;&lt;P&gt;load * Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;A,B&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let a = NoOfFields('x');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lets 'a' with the value 2, even though there's no data in the table and so if i called the sub it would store the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Felipe.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Aug 2017 13:11:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sub-function-script/m-p/1411789#M426867</guid>
      <dc:creator>felipedl</dc:creator>
      <dc:date>2017-08-16T13:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: sub function script</title>
      <link>https://community.qlik.com/t5/QlikView/sub-function-script/m-p/1411790#M426868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, your understanding is right and this routine stored a table as qvd and dropped it afterwards. The meaning of it is to keep the real load-script small and clean and reducing the normally two-lines of store &amp;amp; drop to a single-line for the call - if we exclude the additionally if-condition which is here implemented and which would significantly increase the needed lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And this if-condition displayed very well what could be further done with such a sub-routine. For example the dropping could be optional, the fileformat could be changable - qvd/txt/qvx, ERRORMODE could be implemented and various other things and checks are thinkable - and this only once developed and maintained especially if you put it into an include-variable: &lt;A href="https://community.qlik.com/qlik-blogpost/4142"&gt;The $(Include) which you $(Must_Include) into your toolkit&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Aug 2017 13:13:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sub-function-script/m-p/1411790#M426868</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2017-08-16T13:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: sub function script</title>
      <link>https://community.qlik.com/t5/QlikView/sub-function-script/m-p/1411791#M426869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the clarification.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Aug 2017 13:46:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sub-function-script/m-p/1411791#M426869</guid>
      <dc:creator>vireshkolagimat</dc:creator>
      <dc:date>2017-08-16T13:46:41Z</dc:date>
    </item>
  </channel>
</rss>

