<?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: Syntax for a boolean function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Syntax-for-a-boolean-function/m-p/432547#M161230</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry Kevin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you were talking about VBS Fernando and me we were in a QV script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ciao&lt;/P&gt;&lt;P&gt;Klaus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Jan 2013 21:07:05 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-01-17T21:07:05Z</dc:date>
    <item>
      <title>Syntax for a boolean function</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-for-a-boolean-function/m-p/432543#M161226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to create a VBS function that returns true or false if a date is between StartDate and EndDate. (Just to keep the formulas more compact and readable)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION twixt(Target,StartDate,EndDate)&lt;/P&gt;&lt;P&gt;IF Target &amp;gt; StartDate AND Target &amp;lt; EndDate THEN&lt;/P&gt;&lt;P&gt;twixt = TRUE&lt;/P&gt;&lt;P&gt;ELSE&lt;/P&gt;&lt;P&gt;twixt = FALSE&lt;/P&gt;&lt;P&gt;END IF&lt;/P&gt;&lt;P&gt;END FUNCTION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, this doesn't seem to return either TRUE or FALSE, and when I use it other formulas, such as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF(twixt(BCD,StDate,EDate),sum(Sales),0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just get NULLs as a result. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As usual, there is nothing in the documentation about the method of creating functions. Do I need to declare the function as LOGICAL, BOOLEAN, etc.?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What should I expect as a return value? TRUE/FALSE, or -1/0?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2013 19:22:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-for-a-boolean-function/m-p/432543#M161226</guid>
      <dc:creator />
      <dc:date>2013-01-17T19:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax for a boolean function</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-for-a-boolean-function/m-p/432544#M161227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried using dollar-sign expansion with parameters?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the attached qvw.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The idea is to use a variable&lt;/P&gt;&lt;P&gt;fTwixt = if($1&amp;gt;$2 and $1&amp;lt;$3, 1, 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the expression will be:&lt;/P&gt;&lt;P&gt;=$(fTwixt(Target, StartDate, EndDate))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;Fernando&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2013 19:50:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-for-a-boolean-function/m-p/432544#M161227</guid>
      <dc:creator>fosuzuki</dc:creator>
      <dc:date>2013-01-17T19:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax for a boolean function</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-for-a-boolean-function/m-p/432545#M161228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kevin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in QlikView you can define Procedures by the keyword SUB&lt;/P&gt;&lt;P&gt;but there are no user defined functions like you tried. They are on the wishlist for some time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simple functions can be done with variables as Fernando showed above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ciao&lt;/P&gt;&lt;P&gt;Klaus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2013 20:10:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-for-a-boolean-function/m-p/432545#M161228</guid>
      <dc:creator />
      <dc:date>2013-01-17T20:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax for a boolean function</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-for-a-boolean-function/m-p/432546#M161229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kevin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you assign True value to a variable on VBScript, this var will get the '-1' value. If you assign False, the value is '0'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try with this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;IF(twixt(BCD,StDate,EDate)=-1,sum(Sales),0)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2013 20:46:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-for-a-boolean-function/m-p/432546#M161229</guid>
      <dc:creator>sebastiandperei</dc:creator>
      <dc:date>2013-01-17T20:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax for a boolean function</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-for-a-boolean-function/m-p/432547#M161230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry Kevin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you were talking about VBS Fernando and me we were in a QV script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ciao&lt;/P&gt;&lt;P&gt;Klaus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2013 21:07:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-for-a-boolean-function/m-p/432547#M161230</guid>
      <dc:creator />
      <dc:date>2013-01-17T21:07:05Z</dc:date>
    </item>
  </channel>
</rss>

