<?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 VBScript question in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/VBScript-question/m-p/364239#M1174807</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;When you say in the expression, you mean that you are using the function inside Edit Module only, right?&lt;/P&gt;&lt;P&gt;Can you post your application?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, this type of calculation you can do in native qlikview itself, variables may come handy here. I don't see need of a macro.&lt;/P&gt;&lt;P&gt;You should not use macros extensively, they themselves are slow in execution as well as make whole application itself slow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;Ashutosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 May 2012 11:04:33 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-05-23T11:04:33Z</dc:date>
    <item>
      <title>VBScript question</title>
      <link>https://community.qlik.com/t5/QlikView/VBScript-question/m-p/364238#M1174806</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;I have created a function in the Edit Module in VBScript which given 2 dates return the elapsed time in Days,Hours, Mins, taking into account work hours (8AM - 6PM), weekends and holidays. So if an employee started a job at 4/6/2012 9:03:00 and fiinished 4/12/2011 16:60:00, the function will evaluate that to&amp;nbsp; 5 Days, 7 Hours, 27 Minutes. &lt;/P&gt;&lt;P&gt;The function works correctly when running it from within the Edit Module however it does not when I try to deploy it from within an expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the expression I pass to the function (TimeCard) the following: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=TimeCard(Date1, Date2) where Date1 and Date2 are fields in one of the tables which I read from our database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I doing anything wrong that no values are returned? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Josh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2012 22:58:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBScript-question/m-p/364238#M1174806</guid>
      <dc:creator>jduenyas</dc:creator>
      <dc:date>2012-05-22T22:58:47Z</dc:date>
    </item>
    <item>
      <title>VBScript question</title>
      <link>https://community.qlik.com/t5/QlikView/VBScript-question/m-p/364239#M1174807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;When you say in the expression, you mean that you are using the function inside Edit Module only, right?&lt;/P&gt;&lt;P&gt;Can you post your application?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, this type of calculation you can do in native qlikview itself, variables may come handy here. I don't see need of a macro.&lt;/P&gt;&lt;P&gt;You should not use macros extensively, they themselves are slow in execution as well as make whole application itself slow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;Ashutosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2012 11:04:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBScript-question/m-p/364239#M1174807</guid>
      <dc:creator />
      <dc:date>2012-05-23T11:04:33Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript question</title>
      <link>https://community.qlik.com/t5/QlikView/VBScript-question/m-p/364240#M1174808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Ashutosh,&lt;/P&gt;&lt;P&gt;Sorry i am so late with my reply to you. I got haung up with other burning issues in our company.&lt;/P&gt;&lt;P&gt;The attached is a sample QV and data and a sample VBScript function which is called from the expression but does not give the results I am looking for. &lt;/P&gt;&lt;P&gt;Any input will be appreciated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2012 22:41:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBScript-question/m-p/364240#M1174808</guid>
      <dc:creator>jduenyas</dc:creator>
      <dc:date>2012-05-25T22:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript question</title>
      <link>https://community.qlik.com/t5/QlikView/VBScript-question/m-p/364241#M1174809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Josh,&lt;/P&gt;&lt;P&gt;it's not possible to use vbscript functions in an expression. However you can do the calculation during load in the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;load DATESTART,DATEEND,MultiplyByFive(MO) as MO5; ...&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sven&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 May 2012 13:14:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBScript-question/m-p/364241#M1174809</guid>
      <dc:creator>s_uhlig</dc:creator>
      <dc:date>2012-05-26T13:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript question</title>
      <link>https://community.qlik.com/t5/QlikView/VBScript-question/m-p/364242#M1174810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://community.qlik.com/people/jduenyas" id="jive-5012726619444337207029"&gt;jduenyas&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Sorry for late reply. &lt;/P&gt;&lt;P&gt;You can not call the functions/subroutines defined inside macro section in the expressions of an object. That subroutine can be executed in macro section only.&lt;/P&gt;&lt;P&gt;But if you want a custom function then you can use variables as a function. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, for your requirement, you don't need to use a function you can directly do it inside an expression without using any function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find the attached applicaiton to see examples for both of the cases.&lt;/P&gt;&lt;P&gt;Let me know, if any issue. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;Ashutosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 May 2012 06:45:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBScript-question/m-p/364242#M1174810</guid>
      <dc:creator />
      <dc:date>2012-05-28T06:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript question</title>
      <link>https://community.qlik.com/t5/QlikView/VBScript-question/m-p/364243#M1174811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Sven &lt;/P&gt;&lt;P&gt;thank you for you reply. However your suggestion did not work and I cannot understand why. &lt;/P&gt;&lt;P&gt;The attached is the real function which I am trying to use with some data. &lt;/P&gt;&lt;P&gt;Any suggestion is appreciated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you &lt;/P&gt;&lt;P&gt;Josh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2012 20:43:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBScript-question/m-p/364243#M1174811</guid>
      <dc:creator>jduenyas</dc:creator>
      <dc:date>2012-05-29T20:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript question</title>
      <link>https://community.qlik.com/t5/QlikView/VBScript-question/m-p/364244#M1174812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Once again thank you Ashutosh. &lt;/P&gt;&lt;P&gt;I do not think I can use your suggestion as the function I showed initially was much more simplified than the one I am using. &lt;/P&gt;&lt;P&gt;Attached you will find the "real" function. I would not know how to embed that into a variable as you suggested. &lt;/P&gt;&lt;P&gt;If you have any suggestions or can enlighten me, I will appreciate it. &lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Josh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2012 20:48:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBScript-question/m-p/364244#M1174812</guid>
      <dc:creator>jduenyas</dc:creator>
      <dc:date>2012-05-29T20:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript question</title>
      <link>https://community.qlik.com/t5/QlikView/VBScript-question/m-p/364245#M1174813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Josh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;give &lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;TimeCard(''&amp;amp;EmailReceivedOn,''&amp;amp;QuotedOn) AS ElapsedTime&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a try, which will force the string representation of your dates, &lt;SPAN class="short_text" id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;otherwise they will be just numbers.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps"&gt;Regards &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps"&gt;Sven&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2012 23:21:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBScript-question/m-p/364245#M1174813</guid>
      <dc:creator>s_uhlig</dc:creator>
      <dc:date>2012-05-29T23:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript question</title>
      <link>https://community.qlik.com/t5/QlikView/VBScript-question/m-p/364246#M1174814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://community.qlik.com/people/jduenyas" id="jive-5012726792919223274296"&gt;jduenyas&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;You don't need to put this function in a variable.&lt;/P&gt;&lt;P&gt;It can work fine from macro itself.&lt;/P&gt;&lt;P&gt;The problem why it was not workin in your case was because of date format not being properly parsed into vbscript.&lt;/P&gt;&lt;P&gt;I have corrected it.&lt;/P&gt;&lt;P&gt;I have changed the variables where you assign dtDate1 and dtDate2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find the attached application, let me know if any issue. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;Ashutosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2012 06:55:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBScript-question/m-p/364246#M1174814</guid>
      <dc:creator />
      <dc:date>2012-05-30T06:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript question</title>
      <link>https://community.qlik.com/t5/QlikView/VBScript-question/m-p/364247#M1174815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; You are the BEST!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2012 15:12:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBScript-question/m-p/364247#M1174815</guid>
      <dc:creator>jduenyas</dc:creator>
      <dc:date>2012-05-30T15:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: VBScript question</title>
      <link>https://community.qlik.com/t5/QlikView/VBScript-question/m-p/364248#M1174816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;But I believe BEST in Qlikview world is copyrighted by our dear &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://community.qlik.com/people/johnw" id="jive-222626889704819284765"&gt;John Witherspoon&lt;/A&gt;&amp;nbsp; &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ashutosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2012 09:48:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VBScript-question/m-p/364248#M1174816</guid>
      <dc:creator />
      <dc:date>2012-05-31T09:48:02Z</dc:date>
    </item>
  </channel>
</rss>

