<?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: SV:problem calling a subroutine from within a load in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/problem-calling-a-subroutine-from-within-a-load/m-p/232049#M83721</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right. You can call a sub routine only via "call"..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Jan 2013 21:42:15 GMT</pubDate>
    <dc:creator>rbecher</dc:creator>
    <dc:date>2013-01-10T21:42:15Z</dc:date>
    <item>
      <title>problem calling a subroutine from within a load</title>
      <link>https://community.qlik.com/t5/QlikView/problem-calling-a-subroutine-from-within-a-load/m-p/232043#M83715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I'm having a problem calling a subroutine.&lt;/P&gt;&lt;P&gt;I've created the subroutine:&lt;/P&gt;&lt;P&gt;SUB CheckPrice(pCustomer, pProduct, pSalesDate)&lt;BR /&gt; LOAD SalesPrice&lt;BR /&gt; FROM DateFile.txt&lt;BR /&gt; (txt, codepage is 1252, embedded labels, delimiter is '\t', msq)&lt;BR /&gt; WHERE&lt;BR /&gt; CustomerCode = '$(pCustomer)' AND&lt;BR /&gt; ItemCode = '$(pProduct)' AND&lt;BR /&gt; FromDate &amp;lt;= '$(pSalesDate)' AND&lt;BR /&gt; '$(pSalesDate)' &amp;lt;= ToDate&lt;BR /&gt; ;&lt;BR /&gt;END SUB&lt;/P&gt;&lt;P&gt;When I call the subroutine once for a fixed customer/product/date it returns the price I expect.&lt;/P&gt;&lt;P&gt;However, I want to call the subroutine from within a LOAD. When I try the code below I get 'Error in expresssion:')' expected.&lt;/P&gt;&lt;P&gt;LOAD SalesDate,&lt;BR /&gt; CustomerCode,&lt;BR /&gt; ItemCode,&lt;BR /&gt; IF (ISNULL(Call CheckPrice(CustomerCode, ItemCode, SalesDate)), 'N', 'P') as chkprice&lt;BR /&gt;FROM SalesOrder.qvd&lt;BR /&gt;(qvd);&lt;/P&gt;&lt;P&gt;Any ideas why this is?&lt;/P&gt;&lt;P&gt;Cherian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2011 14:01:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-calling-a-subroutine-from-within-a-load/m-p/232043#M83715</guid>
      <dc:creator />
      <dc:date>2011-04-27T14:01:20Z</dc:date>
    </item>
    <item>
      <title>SV:problem calling a subroutine from within a load</title>
      <link>https://community.qlik.com/t5/QlikView/problem-calling-a-subroutine-from-within-a-load/m-p/232044#M83716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried putting the Sub Call in a dollar expansion?&lt;/P&gt;&lt;P&gt;$( Call CheckPoint( ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2011 14:09:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-calling-a-subroutine-from-within-a-load/m-p/232044#M83716</guid>
      <dc:creator>ToniKautto</dc:creator>
      <dc:date>2011-04-27T14:09:21Z</dc:date>
    </item>
    <item>
      <title>SV:problem calling a subroutine from within a load</title>
      <link>https://community.qlik.com/t5/QlikView/problem-calling-a-subroutine-from-within-a-load/m-p/232045#M83717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Toni&lt;/P&gt;&lt;P&gt;Tried that but it made no difference&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2011 14:22:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-calling-a-subroutine-from-within-a-load/m-p/232045#M83717</guid>
      <dc:creator />
      <dc:date>2011-04-27T14:22:49Z</dc:date>
    </item>
    <item>
      <title>SV:problem calling a subroutine from within a load</title>
      <link>https://community.qlik.com/t5/QlikView/problem-calling-a-subroutine-from-within-a-load/m-p/232046#M83718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking at your example I do not really see how it should work.&lt;/P&gt;&lt;P&gt;The subroutine will only execute a table load, but how does it return a value to trigger the IF conditional check for null? I imagine it would always be interpreted as a NULL.&lt;/P&gt;&lt;P&gt;Have you tried executing the CALL as string in the $-expansion?&lt;/P&gt;&lt;P&gt;$(="IF (ISNULL(Call CheckPrice(CustomerCode, ItemCode, SalesDate)), 'N', 'P')")&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2011 16:10:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-calling-a-subroutine-from-within-a-load/m-p/232046#M83718</guid>
      <dc:creator>ToniKautto</dc:creator>
      <dc:date>2011-04-27T16:10:20Z</dc:date>
    </item>
    <item>
      <title>SV:problem calling a subroutine from within a load</title>
      <link>https://community.qlik.com/t5/QlikView/problem-calling-a-subroutine-from-within-a-load/m-p/232047#M83719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;what you're trying to achieve is a script function. This is not possible in QV, only sub routine without return values.&lt;/P&gt;&lt;P&gt;- Ralf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2011 17:30:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-calling-a-subroutine-from-within-a-load/m-p/232047#M83719</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2011-04-27T17:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: SV:problem calling a subroutine from within a load</title>
      <link>https://community.qlik.com/t5/QlikView/problem-calling-a-subroutine-from-within-a-load/m-p/232048#M83720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's impossible call a subroutine in LOAD statement?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2013 21:08:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-calling-a-subroutine-from-within-a-load/m-p/232048#M83720</guid>
      <dc:creator>farolito20</dc:creator>
      <dc:date>2013-01-10T21:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: SV:problem calling a subroutine from within a load</title>
      <link>https://community.qlik.com/t5/QlikView/problem-calling-a-subroutine-from-within-a-load/m-p/232049#M83721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right. You can call a sub routine only via "call"..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2013 21:42:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-calling-a-subroutine-from-within-a-load/m-p/232049#M83721</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2013-01-10T21:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: SV:problem calling a subroutine from within a load</title>
      <link>https://community.qlik.com/t5/QlikView/problem-calling-a-subroutine-from-within-a-load/m-p/232050#M83722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Damn :s Thanks :s&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About mapping tables and apply match, how do that if I pass more then one field?&lt;/P&gt;&lt;P&gt;For example, I have this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(match(t_cuni,'LTA','FGS','QQ'), 1, applymap('fnConvToQQ',uniBase)) * t_qhnd as cantReturn;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but here, I just pass one field, unibase to mappiing fnConvToQQ'.&lt;/P&gt;&lt;P&gt;how pass two fields? like this? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;applymap('fnConvToQQ',uniBase,cantBase)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2013 21:48:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-calling-a-subroutine-from-within-a-load/m-p/232050#M83722</guid>
      <dc:creator>farolito20</dc:creator>
      <dc:date>2013-01-10T21:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: SV:problem calling a subroutine from within a load</title>
      <link>https://community.qlik.com/t5/QlikView/problem-calling-a-subroutine-from-within-a-load/m-p/232051#M83723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use applymap() multiple times in a LOAD statement. One for each field..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2013 22:35:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-calling-a-subroutine-from-within-a-load/m-p/232051#M83723</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2013-01-10T22:35:01Z</dc:date>
    </item>
  </channel>
</rss>

