<?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 Subrutines in a LOAD in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Subrutines-in-a-LOAD/m-p/144821#M23628</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, is it possible to use a subrutine or sub-loading from a QVD. As example here's my script that is failing:&lt;/P&gt;&lt;P&gt;&lt;I&gt;HNUMC5:&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;&lt;/I&gt;&lt;B&gt;LOAD&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&lt;/B&gt;"HnuD01_01A", "HnuD02_01M", "HnuD04_01E", "HnuD05_01S", // OK&lt;/P&gt;&lt;P&gt;(HnuD01_01A * 100 + HnuD02_01M) &lt;B&gt;as&lt;/B&gt; Periodo, // OK&lt;/P&gt;&lt;P&gt;IF (HnuD10_01A=1405 &lt;B&gt;or&lt;/B&gt; HnuD10_01A=1406,HNUMC5SMN * (-1), 0) &lt;B&gt;as&lt;/B&gt; C_MoraContable, // OK&lt;/P&gt;&lt;P&gt;&lt;B&gt;IsNull((Select Sum(b.HnuMC1SMN * -1) From HNUMC1 b Where a.HnuD01_01A = b.HnuD01_01A And a.HnuD02_01M = b.HnuD02_01M And a.HnuD04_01E = b.HnuD04_01E And a.HnuD05_01S = b.HnuD05_01S And a.HnuD06_01M = b.HnuD06_01M And a.HnuD08_01R = b.HnuD08_01R And a.HnuD13_01M = b.HnuD13_01M And a.HnuD15_01M = b.HnuD15_01M And a.HnuD17_01E = b.HnuD17_01E And a.HnuD1CId = b.HnuD1CId And a.HnuD25_01T = b.HnuD25_01T And a.HnuD26_01C = b.HnuD26_01C And a.HnuD27_01D = b.HnuD27_01D And a.HnuD28_01G = b.HnuD28_01G And a.HnuD29_01T = b.HnuD29_01T And a.HnuD39_01E = b.HnuD39_01E And a.HnuD40_01E = b.HnuD40_01E And a.HnuD44_01S = b.HnuD44_01S And a.HnuD45_01T = b.HnuD45_01T And a.HnuD60_01S = b.HnuD60_01S And a.HnuD61_01F = b.HnuD61_01F And a.HnuD67_01C = b.HnuD67_01C And b.HnuD25_01T in (3,4,5,6)),0) As C_PromPatrimonio // FAIL&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&lt;/B&gt;FROM [HNUMC5_.qvd] (qvd) a;&lt;/P&gt;&lt;P&gt;Think it fails because Qlikview detects the 'where' located i the 'Isnull' argument and the 'FROM [HNUMC5_.QVD] (qvd) is never read. How to make it correctly?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 23 May 2009 05:25:14 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-05-23T05:25:14Z</dc:date>
    <item>
      <title>Subrutines in a LOAD</title>
      <link>https://community.qlik.com/t5/QlikView/Subrutines-in-a-LOAD/m-p/144821#M23628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, is it possible to use a subrutine or sub-loading from a QVD. As example here's my script that is failing:&lt;/P&gt;&lt;P&gt;&lt;I&gt;HNUMC5:&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;&lt;/I&gt;&lt;B&gt;LOAD&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&lt;/B&gt;"HnuD01_01A", "HnuD02_01M", "HnuD04_01E", "HnuD05_01S", // OK&lt;/P&gt;&lt;P&gt;(HnuD01_01A * 100 + HnuD02_01M) &lt;B&gt;as&lt;/B&gt; Periodo, // OK&lt;/P&gt;&lt;P&gt;IF (HnuD10_01A=1405 &lt;B&gt;or&lt;/B&gt; HnuD10_01A=1406,HNUMC5SMN * (-1), 0) &lt;B&gt;as&lt;/B&gt; C_MoraContable, // OK&lt;/P&gt;&lt;P&gt;&lt;B&gt;IsNull((Select Sum(b.HnuMC1SMN * -1) From HNUMC1 b Where a.HnuD01_01A = b.HnuD01_01A And a.HnuD02_01M = b.HnuD02_01M And a.HnuD04_01E = b.HnuD04_01E And a.HnuD05_01S = b.HnuD05_01S And a.HnuD06_01M = b.HnuD06_01M And a.HnuD08_01R = b.HnuD08_01R And a.HnuD13_01M = b.HnuD13_01M And a.HnuD15_01M = b.HnuD15_01M And a.HnuD17_01E = b.HnuD17_01E And a.HnuD1CId = b.HnuD1CId And a.HnuD25_01T = b.HnuD25_01T And a.HnuD26_01C = b.HnuD26_01C And a.HnuD27_01D = b.HnuD27_01D And a.HnuD28_01G = b.HnuD28_01G And a.HnuD29_01T = b.HnuD29_01T And a.HnuD39_01E = b.HnuD39_01E And a.HnuD40_01E = b.HnuD40_01E And a.HnuD44_01S = b.HnuD44_01S And a.HnuD45_01T = b.HnuD45_01T And a.HnuD60_01S = b.HnuD60_01S And a.HnuD61_01F = b.HnuD61_01F And a.HnuD67_01C = b.HnuD67_01C And b.HnuD25_01T in (3,4,5,6)),0) As C_PromPatrimonio // FAIL&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&lt;/B&gt;FROM [HNUMC5_.qvd] (qvd) a;&lt;/P&gt;&lt;P&gt;Think it fails because Qlikview detects the 'where' located i the 'Isnull' argument and the 'FROM [HNUMC5_.QVD] (qvd) is never read. How to make it correctly?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 May 2009 05:25:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subrutines-in-a-LOAD/m-p/144821#M23628</guid>
      <dc:creator />
      <dc:date>2009-05-23T05:25:14Z</dc:date>
    </item>
    <item>
      <title>Subrutines in a LOAD</title>
      <link>https://community.qlik.com/t5/QlikView/Subrutines-in-a-LOAD/m-p/144822#M23629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can't imbed the SQL Select in the middle of a load like that. What you can do is SELECT the fields from HNUMC1 as one table and then JOIN with the HNUMC5_.qvd.&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 May 2009 06:29:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subrutines-in-a-LOAD/m-p/144822#M23629</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2009-05-23T06:29:25Z</dc:date>
    </item>
    <item>
      <title>Subrutines in a LOAD</title>
      <link>https://community.qlik.com/t5/QlikView/Subrutines-in-a-LOAD/m-p/144823#M23630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Rob. Do you mean i shouldn't use the HNUMC1 as a QVD file?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 May 2009 22:28:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subrutines-in-a-LOAD/m-p/144823#M23630</guid>
      <dc:creator />
      <dc:date>2009-05-25T22:28:12Z</dc:date>
    </item>
    <item>
      <title>Subrutines in a LOAD</title>
      <link>https://community.qlik.com/t5/QlikView/Subrutines-in-a-LOAD/m-p/144824#M23631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I doubt that he's saying that. Looking at your example, there's nothing to indicate that HNUMC1 is a QVD file, so I suspect he assumed that it was some SQL database table, same as I did. If it's a QVD file, there's no reason you can't use the QVD file. And in general, my recommendation is to make QVD files rather than having applications read directly from databases.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2009 00:41:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subrutines-in-a-LOAD/m-p/144824#M23631</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-05-27T00:41:24Z</dc:date>
    </item>
    <item>
      <title>Subrutines in a LOAD</title>
      <link>https://community.qlik.com/t5/QlikView/Subrutines-in-a-LOAD/m-p/144825#M23632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, the HNUMC1 and the HNUMC5 are QVD files, excuse me if i wasn't clear. I followed the Rob's recommendation (to make a JOIN) but if have problems with the sintaxis. Yes, John, i've your recommendation in this way:&lt;/P&gt;&lt;P&gt;1. Loaded the all data from the each DB tables to general QVD files without any calculations.&lt;/P&gt;&lt;P&gt;2. Loading the data form de Generals QVD files to news QVD proccesing data and adding special columns.&lt;/P&gt;&lt;P&gt;3. To Make an application using those new QVD files.&lt;/P&gt;&lt;P&gt;My problem is in the point 2. In my last example i'm trying to make a select in each row that i'm loading. So, Robs say that what i can do is to make a JOIN betwen both HNUMC1 and HNUMC5 (QVD files).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2009 01:00:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subrutines-in-a-LOAD/m-p/144825#M23632</guid>
      <dc:creator />
      <dc:date>2009-05-27T01:00:03Z</dc:date>
    </item>
    <item>
      <title>Subrutines in a LOAD</title>
      <link>https://community.qlik.com/t5/QlikView/Subrutines-in-a-LOAD/m-p/144826#M23633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin:0in 0in 0pt;"&gt;This probably isn't relevant to the question at hand, but at our shop we decided to skip your #1 and go straight to #2 from the database. The reasoning was that there was nothing gained by having the intermediate QVD files if the only application reading them was a single other application creating the QVD files that the applications would actually use. That may or may not apply to your situation, and has nothing to do with solving your current problem, so...&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;...back to the original question. I'm not fond of listing the same fields over and over, but I think something like this would work:&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;HNUMC5:&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;LOAD&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;HnuD01_01A&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD02_01M&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD04_01E&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD05_01S&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD06_01M&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD08_01R&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD13_01M&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD15_01M&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD17_01E&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD1CId&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD25_01T&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD26_01C&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD27_01D&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD28_01G&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD29_01T&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD39_01E&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD40_01E&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD44_01S&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD45_01T&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD60_01S&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD61_01F&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD67_01C&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD01_01A * 100 + HnuD02_01M as Periodo&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,if(HnuD10_01A=1405 or HnuD10_01A=1406,HNUMC5SMN * (-1),0) as C_MoraContable&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;FROM [HNUMC5_.qvd] (qvd)&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;;&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;LEFT JOIN ([HNUMC5])&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;LOAD&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;HnuD01_01A&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD02_01M&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD04_01E&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD05_01S&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD06_01M&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD08_01R&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD13_01M&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD15_01M&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD17_01E&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD1CId&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD25_01T&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD26_01C&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD27_01D&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD28_01G&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD29_01T&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD39_01E&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD40_01E&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD44_01S&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD45_01T&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD60_01S&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD61_01F&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD67_01C&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,rangesum(0,sum(if(match(HnuD25_01T,3,4,5,6),HnuMC1SMN * -1))) as C_PromPatrimonio&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;FROM [HNUMC1_.qvd] (qvd)&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;GROUP BY&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;HnuD01_01A&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD02_01M&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD04_01E&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD05_01S&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD06_01M&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD08_01R&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD13_01M&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD15_01M&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD17_01E&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD1CId&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD25_01T&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD26_01C&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD27_01D&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD28_01G&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD29_01T&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD39_01E&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD40_01E&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD44_01S&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD45_01T&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD60_01S&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD61_01F&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD67_01C&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;;&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;DROP FIELDS&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;HnuD06_01M&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD08_01R&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD13_01M&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD15_01M&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD17_01E&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD1CId&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD25_01T&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD26_01C&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD27_01D&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD28_01G&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD29_01T&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD39_01E&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD40_01E&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD44_01S&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD45_01T&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD60_01S&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD61_01F&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;,HnuD67_01C&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;"&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2009 03:05:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subrutines-in-a-LOAD/m-p/144826#M23633</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-05-27T03:05:30Z</dc:date>
    </item>
  </channel>
</rss>

