<?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: Optional Argument in Sub or Function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Optional-Argument-in-Sub-or-Function/m-p/364023#M703106</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;Also, please read this post :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;&lt;A class="jive-link-external-small" href="http://qlikviewmaven.blogspot.co.uk/2011/04/variable-that-acts-like-user-defined.html"&gt;http://qlikviewmaven.blogspot.co.uk/2011/04/variable-that-acts-like-user-defined.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;DV&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 May 2012 20:04:16 GMT</pubDate>
    <dc:creator>IAMDV</dc:creator>
    <dc:date>2012-05-22T20:04:16Z</dc:date>
    <item>
      <title>Optional Argument in Sub or Function</title>
      <link>https://community.qlik.com/t5/QlikView/Optional-Argument-in-Sub-or-Function/m-p/364021#M703104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using QV10 SR3.&amp;nbsp; Can you create a Function or Sub with an optional argument?&amp;nbsp; For example, can I create a Function like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function AddEmUp (a, b, optional c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; AddEmUp = a + b + c&lt;/P&gt;&lt;P&gt;End Function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here, the argument c is optional...so it works if I pass it two or three arguments.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2012 19:32:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optional-Argument-in-Sub-or-Function/m-p/364021#M703104</guid>
      <dc:creator />
      <dc:date>2012-05-22T19:32:15Z</dc:date>
    </item>
    <item>
      <title>Optional Argument in Sub or Function</title>
      <link>https://community.qlik.com/t5/QlikView/Optional-Argument-in-Sub-or-Function/m-p/364022#M703105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can create a function variable (dollar sign expansion with arguments), e.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Define in the script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Set vDateDiff = if(len($2)=0, today(), $2) - $1;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you can call vDateDiff with one or two arguments (second argument defaults to today()):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=$(vDateDiff('1/1/2012'))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=$(vDateDiff('1/1/2012','2/1/2012'))&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2012 19:52:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optional-Argument-in-Sub-or-Function/m-p/364022#M703105</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-05-22T19:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: Optional Argument in Sub or Function</title>
      <link>https://community.qlik.com/t5/QlikView/Optional-Argument-in-Sub-or-Function/m-p/364023#M703106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;Also, please read this post :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;&lt;A class="jive-link-external-small" href="http://qlikviewmaven.blogspot.co.uk/2011/04/variable-that-acts-like-user-defined.html"&gt;http://qlikviewmaven.blogspot.co.uk/2011/04/variable-that-acts-like-user-defined.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri,verdana,arial,sans-serif;"&gt;DV&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2012 20:04:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optional-Argument-in-Sub-or-Function/m-p/364023#M703106</guid>
      <dc:creator>IAMDV</dc:creator>
      <dc:date>2012-05-22T20:04:16Z</dc:date>
    </item>
  </channel>
</rss>

