<?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 create custom function with parameter in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/create-custom-function-with-parameter/m-p/147066#M25523</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How is it possible to create custom function with parameter that you can use in the Expression of chart object avoiding to duplicate n times the same code in all object ?&lt;/P&gt;&lt;P&gt;For example i would like to create this kind of function with 1 parameter $Param1 and reuse it in the expression of several objects :&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;MyFunction($Param1)&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;=if(max(Month)&amp;lt;2,'-',&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;sum({&amp;lt;Month = {"&amp;lt;=&lt;B&gt;$Param1&lt;/B&gt;"}*{"&amp;gt;$(=&lt;B&gt;$Param1&lt;/B&gt;-VRolling_Month)"}*{"&amp;gt;=1"}&amp;gt;} [6 - BREAKDOWN LOSS -- Total machine lost time (Hours)])&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;/&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;sum({&amp;lt;Month = {"&amp;lt;=&lt;B&gt;$Param1&lt;/B&gt;"}*{"&amp;gt;$(=&lt;B&gt;$Param1&lt;/B&gt;-VRolling_Month)"}*{"&amp;gt;=&lt;B&gt;1&lt;/B&gt;"}&amp;gt;} [6 - BREAKDOWN LOSS -- Total opening time (Hours)])*100)&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;End Function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Jun 2009 16:26:57 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-06-18T16:26:57Z</dc:date>
    <item>
      <title>create custom function with parameter</title>
      <link>https://community.qlik.com/t5/QlikView/create-custom-function-with-parameter/m-p/147066#M25523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How is it possible to create custom function with parameter that you can use in the Expression of chart object avoiding to duplicate n times the same code in all object ?&lt;/P&gt;&lt;P&gt;For example i would like to create this kind of function with 1 parameter $Param1 and reuse it in the expression of several objects :&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;MyFunction($Param1)&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;=if(max(Month)&amp;lt;2,'-',&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;sum({&amp;lt;Month = {"&amp;lt;=&lt;B&gt;$Param1&lt;/B&gt;"}*{"&amp;gt;$(=&lt;B&gt;$Param1&lt;/B&gt;-VRolling_Month)"}*{"&amp;gt;=1"}&amp;gt;} [6 - BREAKDOWN LOSS -- Total machine lost time (Hours)])&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;/&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;sum({&amp;lt;Month = {"&amp;lt;=&lt;B&gt;$Param1&lt;/B&gt;"}*{"&amp;gt;$(=&lt;B&gt;$Param1&lt;/B&gt;-VRolling_Month)"}*{"&amp;gt;=&lt;B&gt;1&lt;/B&gt;"}&amp;gt;} [6 - BREAKDOWN LOSS -- Total opening time (Hours)])*100)&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;End Function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2009 16:26:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/create-custom-function-with-parameter/m-p/147066#M25523</guid>
      <dc:creator />
      <dc:date>2009-06-18T16:26:57Z</dc:date>
    </item>
    <item>
      <title>create custom function with parameter</title>
      <link>https://community.qlik.com/t5/QlikView/create-custom-function-with-parameter/m-p/147067#M25524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot define funtions but you can store formulas in variables and pass parameters. Here is a simple example:&lt;/P&gt;&lt;P&gt;Store formula:&lt;/P&gt;&lt;P&gt;var1 = "sum(if(customer=$1 and year=$2,1,0))"&lt;/P&gt;&lt;P&gt;Use in diagram:&lt;/P&gt;&lt;P&gt;=$var1(param1, param2)&lt;/P&gt;&lt;P&gt;Ralf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2009 21:42:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/create-custom-function-with-parameter/m-p/147067#M25524</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2009-06-18T21:42:59Z</dc:date>
    </item>
  </channel>
</rss>

