<?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: Creating custom functions with variables in Qlikview in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Creating-custom-functions-with-variables-in-Qlikview/m-p/879172#M1002594</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this sample file for solution, you can call VB macros in Qlikview scripting&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-4643"&gt;Calling VB function (macro) in Load script to find common string length in two strings&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Jun 2015 04:27:44 GMT</pubDate>
    <dc:creator>jagan</dc:creator>
    <dc:date>2015-06-12T04:27:44Z</dc:date>
    <item>
      <title>Creating custom functions with variables in Qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-custom-functions-with-variables-in-Qlikview/m-p/879171#M1002593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to write a function that calculates a date based on 2 variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In VBA, I'll have:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function GetDate(i as date, j as string)&lt;/P&gt;&lt;P&gt;GetDate = if(j = "NE", date(2015,1,1), &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( date(year(i), month(i), day(i)) &amp;lt; date(2014,1,1) , date(year(i), month(i), day(i)), date(2014,1,1)))&lt;/P&gt;&lt;P&gt;End function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I'll call the function in VB as:&lt;/P&gt;&lt;P&gt;SELECT X as Name,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .....GetDate(Birthdate, City), ..&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is how to translate the same function above in Qlikview. Specifically, my questions are:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1. How to call the GetDate function in the load script&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2. Where to set the variable type (i as date, j as string).&amp;nbsp; I experimented in the module editor for Qlikview but somehow using&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function GetDate(i as date, j as string)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; doesn't work..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help any one can give me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2015 03:38:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-custom-functions-with-variables-in-Qlikview/m-p/879171#M1002593</guid>
      <dc:creator />
      <dc:date>2015-06-12T03:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: Creating custom functions with variables in Qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-custom-functions-with-variables-in-Qlikview/m-p/879172#M1002594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this sample file for solution, you can call VB macros in Qlikview scripting&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-4643"&gt;Calling VB function (macro) in Load script to find common string length in two strings&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2015 04:27:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-custom-functions-with-variables-in-Qlikview/m-p/879172#M1002594</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2015-06-12T04:27:44Z</dc:date>
    </item>
  </channel>
</rss>

