<?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 Calling a Subroutine in Trigger Action in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calling-a-Subroutine-in-Trigger-Action/m-p/331648#M705041</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Also you can get&amp;nbsp; variable and set values as follow&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;set varValNonVol = ActiveDocument.GetVariable("Vol-NonVol")&lt;BR /&gt;varValNonVol.SetContent "Non voluntary",true&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 May 2012 12:31:17 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-05-02T12:31:17Z</dc:date>
    <item>
      <title>Calling a Subroutine in Trigger Action</title>
      <link>https://community.qlik.com/t5/QlikView/Calling-a-Subroutine-in-Trigger-Action/m-p/331644#M705037</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;I am using QV 11 Personal Edition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have written a sub routine to calculate dates based on a selection.&lt;/P&gt;&lt;P&gt;I have kept a slider control and when the value of the slider changes, it should call this subroutine and inturn calculate the dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My sub routine is like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUB SubName&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET var1 = some date conversion&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET var2 = other conversion&lt;/P&gt;&lt;P&gt;ENDSUB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will be using these variables in other controls&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I went to the Field Event Trigger (the field is linked to the slider control) and added an &lt;STRONG&gt;External&lt;/STRONG&gt; -&amp;gt; &lt;STRONG&gt;Run Macro&lt;/STRONG&gt; action for &lt;STRONG&gt;OnSelect&lt;/STRONG&gt; event&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to call the subroutine using&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SubName&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;as well as &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CALL SubName&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both didn't work out. Can anyone help please..&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2012 11:27:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calling-a-Subroutine-in-Trigger-Action/m-p/331644#M705037</guid>
      <dc:creator />
      <dc:date>2012-05-02T11:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a Subroutine in Trigger Action</title>
      <link>https://community.qlik.com/t5/QlikView/Calling-a-Subroutine-in-Trigger-Action/m-p/331645#M705038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oops..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to use the variables already defined in the script editor inside a macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now only I am checking my macro. It is throwing error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help, I am new to QV &amp;amp; macro. How to use the functions of QV inside a macro and set &amp;amp; get variables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is writing macro different from writing a subroutine in the script editor? I am confused.&lt;/P&gt;&lt;P&gt;Can we write a subroutine in &lt;STRONG&gt;Edit Script&lt;/STRONG&gt; area instead of &lt;STRONG&gt;macro&lt;/STRONG&gt;? If so how to call that in an &lt;STRONG&gt;event trigger action&lt;/STRONG&gt;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2012 11:36:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calling-a-Subroutine-in-Trigger-Action/m-p/331645#M705038</guid>
      <dc:creator />
      <dc:date>2012-05-02T11:36:18Z</dc:date>
    </item>
    <item>
      <title>Calling a Subroutine in Trigger Action</title>
      <link>https://community.qlik.com/t5/QlikView/Calling-a-Subroutine-in-Trigger-Action/m-p/331646#M705039</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;In macro you can get variable like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get and set variable value in macro&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set value = ActiveDocument.Variables("VariableName")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure writing a subroutin in the script editor.&amp;nbsp; It is good practice to write macros in Macro Editor.&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>Wed, 02 May 2012 12:05:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calling-a-Subroutine-in-Trigger-Action/m-p/331646#M705039</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2012-05-02T12:05:25Z</dc:date>
    </item>
    <item>
      <title>Calling a Subroutine in Trigger Action</title>
      <link>https://community.qlik.com/t5/QlikView/Calling-a-Subroutine-in-Trigger-Action/m-p/331647#M705040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Writing script is to load data inside application.&lt;/P&gt;&lt;P&gt;Writing macros (CNTR+M). You can write Sub routine as well as function inside MAcros.&lt;/P&gt;&lt;P&gt;Subroutine can be directly called by name and function you have to write Call FunctionName.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2012 12:26:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calling-a-Subroutine-in-Trigger-Action/m-p/331647#M705040</guid>
      <dc:creator />
      <dc:date>2012-05-02T12:26:41Z</dc:date>
    </item>
    <item>
      <title>Calling a Subroutine in Trigger Action</title>
      <link>https://community.qlik.com/t5/QlikView/Calling-a-Subroutine-in-Trigger-Action/m-p/331648#M705041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Also you can get&amp;nbsp; variable and set values as follow&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;set varValNonVol = ActiveDocument.GetVariable("Vol-NonVol")&lt;BR /&gt;varValNonVol.SetContent "Non voluntary",true&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2012 12:31:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calling-a-Subroutine-in-Trigger-Action/m-p/331648#M705041</guid>
      <dc:creator />
      <dc:date>2012-05-02T12:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a Subroutine in Trigger Action</title>
      <link>https://community.qlik.com/t5/QlikView/Calling-a-Subroutine-in-Trigger-Action/m-p/331649#M705042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jagan &amp;amp; Swapnil. Will try these out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May I know how to create a function?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Function&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;End Function&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is throwing error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know what I did, I am unable to open the macro window itself.&lt;/P&gt;&lt;P&gt;When I press Ctlr+M or from the menu, QV is getting minimized. Anybody faced this issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2012 13:08:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calling-a-Subroutine-in-Trigger-Action/m-p/331649#M705042</guid>
      <dc:creator />
      <dc:date>2012-05-02T13:08:47Z</dc:date>
    </item>
    <item>
      <title>Calling a Subroutine in Trigger Action</title>
      <link>https://community.qlik.com/t5/QlikView/Calling-a-Subroutine-in-Trigger-Action/m-p/331650#M705043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; May be there is limitation in personnnel edition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try function as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function funName&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End Function&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2012 04:17:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calling-a-Subroutine-in-Trigger-Action/m-p/331650#M705043</guid>
      <dc:creator />
      <dc:date>2012-05-03T04:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: Calling a Subroutine in Trigger Action</title>
      <link>https://community.qlik.com/t5/QlikView/Calling-a-Subroutine-in-Trigger-Action/m-p/331651#M705044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks swapnil.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the function is not throwing any error and i tried with msgbox and it shows correct value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wrote like this&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Function funName (var)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; blah blah blah&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; funName = blah blah blah&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;End Function&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But how to use this function in a trigger action? I want to pass a date as the param value and it will return another date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using a trigger action for a field value change and setting the return value to another variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried calling the function, but it is &lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;not&lt;/STRONG&gt;&lt;/SPAN&gt; giving any output&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=funName(var1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;as well as&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=funName($(var1))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both didnt work. Any help please?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2012 13:22:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calling-a-Subroutine-in-Trigger-Action/m-p/331651#M705044</guid>
      <dc:creator />
      <dc:date>2012-05-03T13:22:47Z</dc:date>
    </item>
  </channel>
</rss>

