<?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: Use Variables in Partial Reload in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Use-Variables-in-Partial-Reload/m-p/785182#M277852</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joseph, I think the easiest way to accomplish what you need is to create a temporary variable in your script. Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vFirstVerB = replace(vFirstVer,'=','');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PDMigration:&lt;/P&gt;&lt;P&gt;REPLACE LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; ver&lt;/P&gt;&lt;P&gt;&amp;nbsp; , RootObgNo&lt;/P&gt;&lt;P&gt;&amp;nbsp; , RootOblNo&lt;/P&gt;&lt;P&gt;&amp;nbsp; , PDGrade as CurPD&lt;/P&gt;&lt;P&gt;RESIDENT vCRS_RLD&lt;/P&gt;&lt;P&gt;WHERE ver&lt;SPAN style="font-size: 10pt;"&gt; = $(vFirstVerB);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;LET vFirstVerB = null();&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Nov 2014 22:18:59 GMT</pubDate>
    <dc:creator>vgutkovsky</dc:creator>
    <dc:date>2014-11-06T22:18:59Z</dc:date>
    <item>
      <title>Use Variables in Partial Reload</title>
      <link>https://community.qlik.com/t5/QlikView/Use-Variables-in-Partial-Reload/m-p/785181#M277851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been trying many different things based on research in the community, but figured I would post my own question on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have three variables, which I set the values as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vSelectedVer:&amp;nbsp;&amp;nbsp; =GetFieldSelections(ver,', ',20)&lt;/P&gt;&lt;P&gt;vFirstVer:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =SubField(vSelectedVer,', ',1)&lt;/P&gt;&lt;P&gt;vSecondVer:&amp;nbsp;&amp;nbsp;&amp;nbsp; =SubField(vSelectedVer,', ',2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a field "ver" in my app, and a corresponding listbox with following values:&lt;/P&gt;&lt;P&gt;20140930&lt;/P&gt;&lt;P&gt;20140831&lt;/P&gt;&lt;P&gt;20140731&lt;/P&gt;&lt;P&gt;20140630&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want user to select two of the values.&amp;nbsp; So if they select 20140930 and 20140630, the variables look like this:&lt;/P&gt;&lt;P&gt;vSelectedVer:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20140930, 20140630&lt;/P&gt;&lt;P&gt;vFirstVer:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20140930&lt;/P&gt;&lt;P&gt;vSecondVer:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20140630&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can use these in charts, part of set analysis to do different displays and calculations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I have now been trying to do is use these values in a REPLACE LOAD script.&amp;nbsp; I want to run partial, so I can pull a subset of the RESIDENT table, and then I can bring the subset in to make a pivot chart.&amp;nbsp; The resident table carries a portfolio of accounts, each with a different "ver" or monthend identifier.&amp;nbsp; Here is what my REPLACE LOAD script looks like.&amp;nbsp; I haven't made it complex, as I'm just trying to get it to work using variable first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PDMigration:&lt;/P&gt;&lt;P&gt;REPLACE LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; ver&lt;/P&gt;&lt;P&gt;&amp;nbsp; , RootObgNo&lt;/P&gt;&lt;P&gt;&amp;nbsp; , RootOblNo&lt;/P&gt;&lt;P&gt;&amp;nbsp; , PDGrade as CurPD&lt;/P&gt;&lt;P&gt;RESIDENT vCRS_RLD&lt;/P&gt;&lt;P&gt;WHERE ver&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; = $(vFirstVer) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whenever I try it, I get the following script error:&lt;/P&gt;&lt;P&gt;Field not found - &amp;lt;=&amp;gt;&lt;/P&gt;&lt;P&gt;PDMigration:&lt;/P&gt;&lt;P&gt;REPLACE LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; ver&lt;/P&gt;&lt;P&gt;&amp;nbsp; , RootObgNo&lt;/P&gt;&lt;P&gt;&amp;nbsp; , RootOblNo&lt;/P&gt;&lt;P&gt;&amp;nbsp; , PDGrade as CurPD&lt;/P&gt;&lt;P&gt;RESIDENT vCRS_RLD&lt;/P&gt;&lt;P&gt;WHERE ver = =SubField(vSelectedVer,', ',1) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Nov 2014 22:09:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-Variables-in-Partial-Reload/m-p/785181#M277851</guid>
      <dc:creator>jzimolong</dc:creator>
      <dc:date>2014-11-06T22:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: Use Variables in Partial Reload</title>
      <link>https://community.qlik.com/t5/QlikView/Use-Variables-in-Partial-Reload/m-p/785182#M277852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joseph, I think the easiest way to accomplish what you need is to create a temporary variable in your script. Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vFirstVerB = replace(vFirstVer,'=','');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PDMigration:&lt;/P&gt;&lt;P&gt;REPLACE LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; ver&lt;/P&gt;&lt;P&gt;&amp;nbsp; , RootObgNo&lt;/P&gt;&lt;P&gt;&amp;nbsp; , RootOblNo&lt;/P&gt;&lt;P&gt;&amp;nbsp; , PDGrade as CurPD&lt;/P&gt;&lt;P&gt;RESIDENT vCRS_RLD&lt;/P&gt;&lt;P&gt;WHERE ver&lt;SPAN style="font-size: 10pt;"&gt; = $(vFirstVerB);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;LET vFirstVerB = null();&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Nov 2014 22:18:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-Variables-in-Partial-Reload/m-p/785182#M277852</guid>
      <dc:creator>vgutkovsky</dc:creator>
      <dc:date>2014-11-06T22:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: Use Variables in Partial Reload</title>
      <link>https://community.qlik.com/t5/QlikView/Use-Variables-in-Partial-Reload/m-p/785183#M277853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the suggestion.&amp;nbsp; I made the updates and I still get the following error in the script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Field not found - &amp;lt;vSelectedVer&amp;gt;&lt;/P&gt;&lt;P&gt;PDMigration:&lt;/P&gt;&lt;P&gt;REPLACE LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; ver&lt;/P&gt;&lt;P&gt;&amp;nbsp; , RootObgNo&lt;/P&gt;&lt;P&gt;&amp;nbsp; , RootOblNo&lt;/P&gt;&lt;P&gt;&amp;nbsp; , PDGrade as CurPD&lt;/P&gt;&lt;P&gt;RESIDENT vCRS_RLD&lt;/P&gt;&lt;P&gt;WHERE ver = SubField(vSelectedVer,', ',1)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Nov 2014 22:25:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-Variables-in-Partial-Reload/m-p/785183#M277853</guid>
      <dc:creator>jzimolong</dc:creator>
      <dc:date>2014-11-06T22:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: Use Variables in Partial Reload</title>
      <link>https://community.qlik.com/t5/QlikView/Use-Variables-in-Partial-Reload/m-p/785184#M277854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My mistake, the above won't work for your type of variable expression. The only way (that I can see) to do it is through adding triggers. In your case, open Document Properties &amp;gt;&amp;gt; Triggers &amp;gt;&amp;gt; Field Event Triggers &amp;gt;&amp;gt; ver. Press the "Add Action" button under OnSelect. Press Add &amp;gt;&amp;gt; External &amp;gt;&amp;gt; Set Variable. For the variable name, enter &lt;STRONG&gt;vFirstVerB&lt;/STRONG&gt;. For the variable value, enter &lt;STRONG&gt;=vFirstVer&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create the same trigger for OnChange.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then your load script can be as I wrote above except for setting vFirstVerB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PDMigration:&lt;/P&gt;&lt;P&gt;REPLACE LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; ver&lt;/P&gt;&lt;P&gt;&amp;nbsp; , RootObgNo&lt;/P&gt;&lt;P&gt;&amp;nbsp; , RootOblNo&lt;/P&gt;&lt;P&gt;&amp;nbsp; , PDGrade as CurPD&lt;/P&gt;&lt;P&gt;RESIDENT vCRS_RLD&lt;/P&gt;&lt;P&gt;WHERE ver&lt;SPAN style="font-size: 10pt;"&gt; = $(vFirstVerB);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;It's not very elegant, but I honestly can't think of another way of doing it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Vlad&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Nov 2014 23:07:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-Variables-in-Partial-Reload/m-p/785184#M277854</guid>
      <dc:creator>vgutkovsky</dc:creator>
      <dc:date>2014-11-06T23:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: Use Variables in Partial Reload</title>
      <link>https://community.qlik.com/t5/QlikView/Use-Variables-in-Partial-Reload/m-p/785185#M277855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Vlad, this appears to be working!&amp;nbsp; I can now further expand the script.&amp;nbsp; Thanks again, this gets me over the first hurdle.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Nov 2014 23:20:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-Variables-in-Partial-Reload/m-p/785185#M277855</guid>
      <dc:creator>jzimolong</dc:creator>
      <dc:date>2014-11-06T23:20:03Z</dc:date>
    </item>
  </channel>
</rss>

