<?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 Re: Creating Qlikview scripts to trigger QVWs in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Creating-Qlikview-scripts-to-trigger-QVWs/m-p/724838#M1059487</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 think you are missing peek the values from the actual fields?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vDateInterval = peek('AS_OF_DT', 0, 'FromTable') - date(peek('AS_OF_DT_QVD',0, 'From table') ,'MM/DD/YYYY');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should work if you&amp;nbsp; have only one value in these fields (it gets the first one).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Oct 2014 19:00:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-10-14T19:00:08Z</dc:date>
    <item>
      <title>Creating Qlikview scripts to trigger QVWs</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-Qlikview-scripts-to-trigger-QVWs/m-p/724836#M1059485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp; I am trying to create a qlikview script that can run other scripts if and when a certain condition is satisfied.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The idea was to compare the maximum date from database for a table and compare it with the max date in the QVD.&lt;/P&gt;&lt;P&gt;If the difference between the dates is &amp;gt; 0 then i would run the execute command to refresh the QVD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After i pick up the max dates this is what i am doing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vDateInterval = AS_OF_DT - date(AS_OF_DT_QVD,'MM/DD/YYYY');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if( '$(vDateInterval)' &amp;gt; 0) then &lt;/P&gt;&lt;P&gt;execute "***.bat";&lt;/P&gt;&lt;P&gt;else &lt;/P&gt;&lt;P&gt;&amp;nbsp; exit script;&lt;/P&gt;&lt;P&gt;end if;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However when i debug the script i dont see any value in the vDateInterval variable and as a result my if-then-else doesnt seem to be working properly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CAn any i done wrong here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Oct 2014 17:40:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-Qlikview-scripts-to-trigger-QVWs/m-p/724836#M1059485</guid>
      <dc:creator>sabreyals</dc:creator>
      <dc:date>2014-10-14T17:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Qlikview scripts to trigger QVWs</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-Qlikview-scripts-to-trigger-QVWs/m-p/724837#M1059486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suppose it depends on AS_OF_DT and &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;AS_OF_DT_QVD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you add some trace before Let statement and post the trace or the log?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Oct 2014 18:31:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-Qlikview-scripts-to-trigger-QVWs/m-p/724837#M1059486</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2014-10-14T18:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Qlikview scripts to trigger QVWs</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-Qlikview-scripts-to-trigger-QVWs/m-p/724838#M1059487</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 think you are missing peek the values from the actual fields?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vDateInterval = peek('AS_OF_DT', 0, 'FromTable') - date(peek('AS_OF_DT_QVD',0, 'From table') ,'MM/DD/YYYY');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should work if you&amp;nbsp; have only one value in these fields (it gets the first one).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Oct 2014 19:00:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-Qlikview-scripts-to-trigger-QVWs/m-p/724838#M1059487</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-14T19:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Qlikview scripts to trigger QVWs</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-Qlikview-scripts-to-trigger-QVWs/m-p/724839#M1059488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Massimo,&lt;/P&gt;&lt;P&gt;&amp;nbsp; I used the trace statement like this &lt;/P&gt;&lt;P&gt;trace $(vDateInterval)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and here's what i got&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;10/14/2014 3:34:50 PM: 0036&amp;nbsp; Let vDateInterval =&amp;nbsp; peek(AS_OF_DT,0,'A') - date(peek(AS_OF_DT_QVD,0,'B'),'MM/DD/YYYY')&lt;BR /&gt;10/14/2014 3:34:50 PM: 0038&amp;nbsp; trace &lt;BR /&gt;10/14/2014 3:34:50 PM: 0038&amp;nbsp; &lt;/P&gt;&lt;P&gt;10/14/2014 3:34:50 PM:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Execution finished.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The variable doesnt seem to be holding any value.&lt;/P&gt;&lt;P&gt;If i create a list box in the document i am able to see the 2 date fields and their values. Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Oct 2014 19:39:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-Qlikview-scripts-to-trigger-QVWs/m-p/724839#M1059488</guid>
      <dc:creator>sabreyals</dc:creator>
      <dc:date>2014-10-14T19:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Qlikview scripts to trigger QVWs</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-Qlikview-scripts-to-trigger-QVWs/m-p/724840#M1059489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan,&lt;/P&gt;&lt;P&gt;&amp;nbsp; thanks for your reply. I am using the peek function now but still my variable sems to be empty.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Oct 2014 19:40:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-Qlikview-scripts-to-trigger-QVWs/m-p/724840#M1059489</guid>
      <dc:creator>sabreyals</dc:creator>
      <dc:date>2014-10-14T19:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Qlikview scripts to trigger QVWs</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-Qlikview-scripts-to-trigger-QVWs/m-p/724841#M1059490</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;could please define a variable for each date field like:&lt;/P&gt;&lt;P&gt;let vDateInterval1 = peek('AS_OF_DT',0,'A');&lt;/P&gt;&lt;P&gt;let vDateInterval2 = peek('AS_OF_DT_QVD',0,'B'); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and post the content of the variables after reloading your document. It's also possible the subtraction somehow doesn't work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Oct 2014 19:57:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-Qlikview-scripts-to-trigger-QVWs/m-p/724841#M1059490</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-14T19:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Qlikview scripts to trigger QVWs</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-Qlikview-scripts-to-trigger-QVWs/m-p/724842#M1059491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you have some problems in &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;AS_OF_DT and &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;AS_OF_DT_QVD&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Are these variables or fields? If variable trace it, maybe they are empty&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If they are&amp;nbsp; variables, to get the max date from a qvd you should use something like (same suggestion as Stefan)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;final:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;load max(Orderdate) as Orderdate&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;from final.qvd (qvd);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;vMaxOrderdate = peek('Orderdate');&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;trace $(vMaxOrderdate);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Post your script, if possible&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Oct 2014 19:57:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-Qlikview-scripts-to-trigger-QVWs/m-p/724842#M1059491</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2014-10-14T19:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Qlikview scripts to trigger QVWs</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-Qlikview-scripts-to-trigger-QVWs/m-p/724843#M1059492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I missed out the single quotes for the field name, that is why my variables were holding a null value. Issue resolved now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Other than Peek i came across another function called FieldValue which can be used in a similar way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Oct 2014 18:45:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-Qlikview-scripts-to-trigger-QVWs/m-p/724843#M1059492</guid>
      <dc:creator>sabreyals</dc:creator>
      <dc:date>2014-10-15T18:45:28Z</dc:date>
    </item>
  </channel>
</rss>

