<?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 VB Syntax Question in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/VB-Syntax-Question/m-p/142281#M505629</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://community.qlik.com/people/vwalker" id="jive-358826716172348077849"&gt;vwalker&lt;/A&gt;, &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://community.qlik.com/people/troyansky" id="jive-231026716172475754849"&gt;Oleg Troyansky&lt;/A&gt;, &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://community.qlik.com/people/robwunderlich" id="jive-228626716172497654849"&gt;Rob Wunderlich,&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a similar problem. I have one field ReloadDate which carries only the date when the report was reloaded. I need to compare ReloadDate with current date in a macro written using VBScript.. so how can I do that?&amp;nbsp; &lt;/P&gt;&lt;P&gt;I tried with &lt;/P&gt;&lt;P&gt; set dte = ActiveDocument.Fields("ReloadDate").GetPossibleValues&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if&amp;nbsp; (dte = Date) then&lt;/P&gt;&lt;P&gt; ------------------&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the type mismatch error occures. Also tried with &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if&amp;nbsp; (dte.item(0) = Date) then&lt;/P&gt;&lt;P&gt; ------------------&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But again "Wrong number of arguments or invalid property assignment: 'dte.item'" error occures.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to fix the issue??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reply&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 May 2012 09:36:29 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-05-29T09:36:29Z</dc:date>
    <item>
      <title>VB Syntax Question</title>
      <link>https://community.qlik.com/t5/QlikView/VB-Syntax-Question/m-p/142277#M505625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everybody,&lt;/P&gt;&lt;P&gt;I have a quick question on VB syntax. I have a short macro that selects the current year in the date selector field. The syntax looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields(&lt;/P&gt;&lt;P&gt;"Calendar Year"). &lt;B&gt;Select&lt;/B&gt; &lt;B&gt;YEAR&lt;/B&gt;(&lt;B&gt;now&lt;/B&gt;())&lt;/P&gt;&lt;P&gt;Instead of using the now() function, I want to use a variable that stores the date of the last refresh. What would be the syntax to use a variable? I can't figure it out!&lt;/P&gt;&lt;P&gt;Thank you!!&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2009 22:32:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VB-Syntax-Question/m-p/142277#M505625</guid>
      <dc:creator />
      <dc:date>2009-04-23T22:32:54Z</dc:date>
    </item>
    <item>
      <title>VB Syntax Question</title>
      <link>https://community.qlik.com/t5/QlikView/VB-Syntax-Question/m-p/142278#M505626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you need to use another API GetContent to retreive the value out of the QlikView variable. Here is an example:&lt;/P&gt;&lt;P&gt;set v = ActiveDocument.Variables("Variable1")&lt;BR /&gt;msgbox(v.GetContent.String)&lt;/P&gt;&lt;P&gt;In your case, if you'd like to write it all in one line:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("Calendar Year"). &lt;B&gt;Select&lt;/B&gt; ActiveDocument.Variables("vLastReload").GetContent.String&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just be aware of the Date/Number formatting - what are you expecting to get out of the variable - the number or the formatted string? In order to ensure that you are getting the number, use function num() when you assign the variable in your script.&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Oleg&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2009 22:50:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VB-Syntax-Question/m-p/142278#M505626</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2009-04-23T22:50:37Z</dc:date>
    </item>
    <item>
      <title>VB Syntax Question</title>
      <link>https://community.qlik.com/t5/QlikView/VB-Syntax-Question/m-p/142279#M505627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;An interesting variation is to use the extended search syntax with Select:&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("Calendar Year").Select " =[Calendar Year] = '$(vLastReload)' "&lt;/P&gt;&lt;P&gt;Same caveat applies re Date/Number formatting. But you can debug by testing the search expression in a listbox.&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Apr 2009 01:10:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VB-Syntax-Question/m-p/142279#M505627</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2009-04-24T01:10:37Z</dc:date>
    </item>
    <item>
      <title>VB Syntax Question</title>
      <link>https://community.qlik.com/t5/QlikView/VB-Syntax-Question/m-p/142280#M505628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You guys are both awesome, thank you so much for the help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Apr 2009 02:14:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VB-Syntax-Question/m-p/142280#M505628</guid>
      <dc:creator />
      <dc:date>2009-04-24T02:14:27Z</dc:date>
    </item>
    <item>
      <title>VB Syntax Question</title>
      <link>https://community.qlik.com/t5/QlikView/VB-Syntax-Question/m-p/142281#M505629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://community.qlik.com/people/vwalker" id="jive-358826716172348077849"&gt;vwalker&lt;/A&gt;, &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://community.qlik.com/people/troyansky" id="jive-231026716172475754849"&gt;Oleg Troyansky&lt;/A&gt;, &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://community.qlik.com/people/robwunderlich" id="jive-228626716172497654849"&gt;Rob Wunderlich,&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a similar problem. I have one field ReloadDate which carries only the date when the report was reloaded. I need to compare ReloadDate with current date in a macro written using VBScript.. so how can I do that?&amp;nbsp; &lt;/P&gt;&lt;P&gt;I tried with &lt;/P&gt;&lt;P&gt; set dte = ActiveDocument.Fields("ReloadDate").GetPossibleValues&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if&amp;nbsp; (dte = Date) then&lt;/P&gt;&lt;P&gt; ------------------&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the type mismatch error occures. Also tried with &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if&amp;nbsp; (dte.item(0) = Date) then&lt;/P&gt;&lt;P&gt; ------------------&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But again "Wrong number of arguments or invalid property assignment: 'dte.item'" error occures.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to fix the issue??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reply&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2012 09:36:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VB-Syntax-Question/m-p/142281#M505629</guid>
      <dc:creator />
      <dc:date>2012-05-29T09:36:29Z</dc:date>
    </item>
    <item>
      <title>VB Syntax Question</title>
      <link>https://community.qlik.com/t5/QlikView/VB-Syntax-Question/m-p/142282#M505630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;GetPossibleValues returns an array of FieldValue which is going to take some extra processing. Instead how about:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If ActiveDocument.Evaluate("only(ReloadDate) = today(1)") then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2012 19:59:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VB-Syntax-Question/m-p/142282#M505630</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2012-05-31T19:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: VB Syntax Question</title>
      <link>https://community.qlik.com/t5/QlikView/VB-Syntax-Question/m-p/142283#M505631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No Rob that also did not work..&lt;/P&gt;&lt;P&gt;But i have done one thing... &lt;/P&gt;&lt;P&gt;I used this condition instead, in a variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(MakeDate(Year(ReloadDate), Month(ReloadDate), Day(ReloadDate)) = &lt;/P&gt;&lt;P&gt;MakeDate(Year(Today()), Month(Today()), Day(Today())), 1, 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way I achieved what I needed to.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jun 2012 10:45:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VB-Syntax-Question/m-p/142283#M505631</guid>
      <dc:creator />
      <dc:date>2012-06-01T10:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: VB Syntax Question</title>
      <link>https://community.qlik.com/t5/QlikView/VB-Syntax-Question/m-p/142284#M505632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Oleg - I have been struggling with this issue for a while - it worked like a charm!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2012 20:35:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/VB-Syntax-Question/m-p/142284#M505632</guid>
      <dc:creator />
      <dc:date>2012-06-28T20:35:22Z</dc:date>
    </item>
  </channel>
</rss>

