<?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: How to pass a function to a custom variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-pass-a-function-to-a-custom-variable/m-p/1696320#M725226</link>
    <description>&lt;P&gt;This approach doesn't raise an error, but it returns an incorrect value = Dec 1899. Looks like the AddMonths function doesn't work properly when nested within a custom variable?&lt;/P&gt;</description>
    <pubDate>Fri, 24 Apr 2020 04:42:36 GMT</pubDate>
    <dc:creator>JSamuel_MHV</dc:creator>
    <dc:date>2020-04-24T04:42:36Z</dc:date>
    <item>
      <title>How to pass a function to a custom variable</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-pass-a-function-to-a-custom-variable/m-p/1696296#M725224</link>
      <description>&lt;P&gt;I've created a custom variable that accepts a date parameter and returns a value. It works as expected when a date is passed through to the function, but doesn't work when a function is passed through.&lt;/P&gt;&lt;P&gt;For example, my custom variable VDate_Calc is defined as: monthname($1). Passing today's date to the variable like so: =$(vDate_Calc(Today())) returns Apr 2020 as expected. However, I receive an error when I try passing a function through to the variable like so:&amp;nbsp;=$(vDate_Calc(AddMonths(Today(),1)))&lt;/P&gt;&lt;P&gt;The error message reads "Error: Error in expression: AddMonths takes 2-3 parameters". However&amp;nbsp;AddMonths(Today(),1) returns the correct value 24/05/2020.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions on how to fix this error?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-pass-a-function-to-a-custom-variable/m-p/1696296#M725224</guid>
      <dc:creator>JSamuel_MHV</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass a function to a custom variable</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-pass-a-function-to-a-custom-variable/m-p/1696318#M725225</link>
      <description>&lt;P&gt;The comma from the function will be interpreted as a parameter-delimiter to the variable and therefore it failed. This means you need to ensure that the function is calculated within the variable or you need a different approach. To the first you could try something like this:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;$(vDate_Calc(&lt;STRONG&gt;$(=&lt;/STRONG&gt;AddMonths(Today(),1)&lt;STRONG&gt;)&lt;/STRONG&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2020 04:33:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-pass-a-function-to-a-custom-variable/m-p/1696318#M725225</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2020-04-24T04:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass a function to a custom variable</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-pass-a-function-to-a-custom-variable/m-p/1696320#M725226</link>
      <description>&lt;P&gt;This approach doesn't raise an error, but it returns an incorrect value = Dec 1899. Looks like the AddMonths function doesn't work properly when nested within a custom variable?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2020 04:42:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-pass-a-function-to-a-custom-variable/m-p/1696320#M725226</guid>
      <dc:creator>JSamuel_MHV</dc:creator>
      <dc:date>2020-04-24T04:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass a function to a custom variable</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-pass-a-function-to-a-custom-variable/m-p/1696343#M725227</link>
      <description>&lt;P&gt;My suggestion should work within the UI - within the script the feature of creating an adhoc variable with $(= …) isn't available. In general is the approach to nest variables especially if they should contain functions difficult and the efforts to get the various syntax-requirements working much bigger as keeping the logics more simple.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2020 05:59:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-pass-a-function-to-a-custom-variable/m-p/1696343#M725227</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2020-04-24T05:59:53Z</dc:date>
    </item>
  </channel>
</rss>

