<?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 Creating/setting a variable in a UDF for use in the script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Creating-setting-a-variable-in-a-UDF-for-use-in-the-script/m-p/1398529#M816264</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey all, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For a flag I'm attempting to generate, I need to create a function that will read in the current month of a project (in my calendar) and return the next month. I've been having trouble finding good documentation defining the relationship between module (User Defined Function) and the script. Here is the current function I've developed: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function NextMonth(MonthParam)&lt;/P&gt;&lt;P&gt;dim NewMonth&lt;/P&gt;&lt;P&gt;IF MonthParam = "Oct" then set vNewMonth = "Nov"&lt;/P&gt;&lt;P&gt;IF MonthParam = "Nov" then set vNewMonth = "Dec"&lt;/P&gt;&lt;P&gt;IF MonthParam = "Dec" then set vNewMonth = "Jan"&lt;/P&gt;&lt;P&gt;IF MonthParam = "Jan" then set vNewMonth = "Feb"&lt;/P&gt;&lt;P&gt;IF MonthParam = "Feb" then set vNewMonth = "Mar"&lt;/P&gt;&lt;P&gt;IF MonthParam = "Mar" then set vNewMonth = "Apr"&lt;/P&gt;&lt;P&gt;IF MonthParam = "Apr" then set vNewMonth = "May"&lt;/P&gt;&lt;P&gt;IF MonthParam = "May" then set vNewMonth = "Jun"&lt;/P&gt;&lt;P&gt;IF MonthParam = "Jun" then set vNewMonth = "Jul"&lt;/P&gt;&lt;P&gt;IF MonthParam = "Jul" then set vNewMonth = "Aug"&lt;/P&gt;&lt;P&gt;IF MonthParam = "Aug" then set vNewMonth = "Sep"&lt;/P&gt;&lt;P&gt;IF MonthParam = "Sep" then set vNewMonth = "Oct"&lt;/P&gt;&lt;P&gt;end function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A few of the things I'm curious about are: &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Do you need to define a variable type for an input parameter&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Can you have a function return a value, or must you set a new variable in the function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Can you input a string? How do the quotes work, a single quote is a comment and leaving it blank seems wrong&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - How do you use a variable you set in a function in your script? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Creating/setting a variable in a UDF for use in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-setting-a-variable-in-a-UDF-for-use-in-the-script/m-p/1398529#M816264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey all, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For a flag I'm attempting to generate, I need to create a function that will read in the current month of a project (in my calendar) and return the next month. I've been having trouble finding good documentation defining the relationship between module (User Defined Function) and the script. Here is the current function I've developed: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function NextMonth(MonthParam)&lt;/P&gt;&lt;P&gt;dim NewMonth&lt;/P&gt;&lt;P&gt;IF MonthParam = "Oct" then set vNewMonth = "Nov"&lt;/P&gt;&lt;P&gt;IF MonthParam = "Nov" then set vNewMonth = "Dec"&lt;/P&gt;&lt;P&gt;IF MonthParam = "Dec" then set vNewMonth = "Jan"&lt;/P&gt;&lt;P&gt;IF MonthParam = "Jan" then set vNewMonth = "Feb"&lt;/P&gt;&lt;P&gt;IF MonthParam = "Feb" then set vNewMonth = "Mar"&lt;/P&gt;&lt;P&gt;IF MonthParam = "Mar" then set vNewMonth = "Apr"&lt;/P&gt;&lt;P&gt;IF MonthParam = "Apr" then set vNewMonth = "May"&lt;/P&gt;&lt;P&gt;IF MonthParam = "May" then set vNewMonth = "Jun"&lt;/P&gt;&lt;P&gt;IF MonthParam = "Jun" then set vNewMonth = "Jul"&lt;/P&gt;&lt;P&gt;IF MonthParam = "Jul" then set vNewMonth = "Aug"&lt;/P&gt;&lt;P&gt;IF MonthParam = "Aug" then set vNewMonth = "Sep"&lt;/P&gt;&lt;P&gt;IF MonthParam = "Sep" then set vNewMonth = "Oct"&lt;/P&gt;&lt;P&gt;end function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A few of the things I'm curious about are: &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Do you need to define a variable type for an input parameter&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Can you have a function return a value, or must you set a new variable in the function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Can you input a string? How do the quotes work, a single quote is a comment and leaving it blank seems wrong&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - How do you use a variable you set in a function in your script? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-setting-a-variable-in-a-UDF-for-use-in-the-script/m-p/1398529#M816264</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Creating/setting a variable in a UDF for use in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-setting-a-variable-in-a-UDF-for-use-in-the-script/m-p/1398530#M816265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would create a variable using this (I usually dont use macros or Vb script)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;Date(Addmonths(MakeDate(1900,'$1'),1),'MMM')&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and use like this&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=$(vNextMonth(02)) /&lt;/STRONG&gt;/ returns 'mar'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capturar.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/176247_Capturar.PNG" style="height: 188px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Sep 2017 13:06:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-setting-a-variable-in-a-UDF-for-use-in-the-script/m-p/1398530#M816265</guid>
      <dc:creator>Clever_Anjos</dc:creator>
      <dc:date>2017-09-12T13:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Creating/setting a variable in a UDF for use in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-setting-a-variable-in-a-UDF-for-use-in-the-script/m-p/1398531#M816266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks! works like a charm&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Sep 2017 13:12:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-setting-a-variable-in-a-UDF-for-use-in-the-script/m-p/1398531#M816266</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-12T13:12:41Z</dc:date>
    </item>
  </channel>
</rss>

