<?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 Call Subroutine based on file name in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Call-Subroutine-based-on-file-name/m-p/1063254#M355675</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I need to call a specific subroutine based on the name of the file. Somthing like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;If (&lt;SPAN style="color: #0000ff;"&gt;DocumentName&lt;/SPAN&gt;()= 'Model', 'CALL BASE', 'CALL MI')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Looking for help on how to write the script&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Zag&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Feb 2016 19:29:39 GMT</pubDate>
    <dc:creator>zagzebski</dc:creator>
    <dc:date>2016-02-05T19:29:39Z</dc:date>
    <item>
      <title>Call Subroutine based on file name</title>
      <link>https://community.qlik.com/t5/QlikView/Call-Subroutine-based-on-file-name/m-p/1063254#M355675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I need to call a specific subroutine based on the name of the file. Somthing like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;If (&lt;SPAN style="color: #0000ff;"&gt;DocumentName&lt;/SPAN&gt;()= 'Model', 'CALL BASE', 'CALL MI')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Looking for help on how to write the script&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Zag&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Feb 2016 19:29:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Call-Subroutine-based-on-file-name/m-p/1063254#M355675</guid>
      <dc:creator>zagzebski</dc:creator>
      <dc:date>2016-02-05T19:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: Call Subroutine based on file name</title>
      <link>https://community.qlik.com/t5/QlikView/Call-Subroutine-based-on-file-name/m-p/1063255#M355676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the script it should be like this I guess:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14547010380096111 jive_text_macro" jivemacro_uid="_14547010380096111"&gt;
&lt;P&gt;IF DocumentName() = 'Model' THEN&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALL BASE&lt;/P&gt;
&lt;P&gt;ELSE&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALL MI&lt;/P&gt;
&lt;P&gt;END IF&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if the logic needs to work inside a LOAD statement it must be like this: &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;(I guess this is not what you are looking for)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_1454701050122810" jivemacro_uid="_1454701050122810"&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If( DocumentName() = 'Model', BASE() , MI() ) AS aCalc&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The BASE and MI must then be Functions implemented in VBScript which can be called directly from a LOAD SCRIPT without a problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Feb 2016 19:37:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Call-Subroutine-based-on-file-name/m-p/1063255#M355676</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2016-02-05T19:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: Call Subroutine based on file name</title>
      <link>https://community.qlik.com/t5/QlikView/Call-Subroutine-based-on-file-name/m-p/1063256#M355677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So simple. Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Feb 2016 19:43:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Call-Subroutine-based-on-file-name/m-p/1063256#M355677</guid>
      <dc:creator>zagzebski</dc:creator>
      <dc:date>2016-02-05T19:43:30Z</dc:date>
    </item>
  </channel>
</rss>

