<?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 variable not resolving as expected in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/variable-not-resolving-as-expected/m-p/1924968#M1218738</link>
    <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone pls help me with below code&lt;/P&gt;
&lt;P&gt;I am getting error wen running below script.&lt;/P&gt;
&lt;P&gt;There is some issue when i try to use these in load statement -&amp;nbsp;$(vSelectMeasure),$(=vSelectMeasure)&lt;/P&gt;
&lt;P&gt;I am trying to fetch minimum string of sales i,e; 150 by resolving the defined variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let vSelectMeasure ='=MinString(Sales)';&lt;/P&gt;
&lt;P&gt;MyTable1:&amp;nbsp;&lt;BR /&gt;Load *,'$(vSelectMeasure)',$(vSelectMeasure),$(=vSelectMeasure);&lt;BR /&gt;Load * inline [&lt;BR /&gt;Dim, Sales&lt;BR /&gt;A, 150&lt;BR /&gt;A, 200&lt;BR /&gt;B, 240&lt;BR /&gt;B, 230&lt;BR /&gt;C, 410&lt;BR /&gt;C, 330 ];&lt;/P&gt;</description>
    <pubDate>Sun, 01 May 2022 19:28:41 GMT</pubDate>
    <dc:creator>srihitha</dc:creator>
    <dc:date>2022-05-01T19:28:41Z</dc:date>
    <item>
      <title>variable not resolving as expected</title>
      <link>https://community.qlik.com/t5/QlikView/variable-not-resolving-as-expected/m-p/1924968#M1218738</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone pls help me with below code&lt;/P&gt;
&lt;P&gt;I am getting error wen running below script.&lt;/P&gt;
&lt;P&gt;There is some issue when i try to use these in load statement -&amp;nbsp;$(vSelectMeasure),$(=vSelectMeasure)&lt;/P&gt;
&lt;P&gt;I am trying to fetch minimum string of sales i,e; 150 by resolving the defined variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let vSelectMeasure ='=MinString(Sales)';&lt;/P&gt;
&lt;P&gt;MyTable1:&amp;nbsp;&lt;BR /&gt;Load *,'$(vSelectMeasure)',$(vSelectMeasure),$(=vSelectMeasure);&lt;BR /&gt;Load * inline [&lt;BR /&gt;Dim, Sales&lt;BR /&gt;A, 150&lt;BR /&gt;A, 200&lt;BR /&gt;B, 240&lt;BR /&gt;B, 230&lt;BR /&gt;C, 410&lt;BR /&gt;C, 330 ];&lt;/P&gt;</description>
      <pubDate>Sun, 01 May 2022 19:28:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/variable-not-resolving-as-expected/m-p/1924968#M1218738</guid>
      <dc:creator>srihitha</dc:creator>
      <dc:date>2022-05-01T19:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: variable not resolving as expected</title>
      <link>https://community.qlik.com/t5/QlikView/variable-not-resolving-as-expected/m-p/1925007#M1218740</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/177661"&gt;@srihitha&lt;/a&gt;&amp;nbsp;wrote:&amp;nbsp;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;A href="https://www.employeeconnection.one/" target="_self"&gt;&lt;FONT color="#FFFFFF"&gt;EmployeeConnection&lt;/FONT&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;BR /&gt;
&lt;P&gt;Hi ,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone pls help me with below code&lt;/P&gt;
&lt;P&gt;I am getting error wen running below script.&lt;/P&gt;
&lt;P&gt;There is some issue when i try to use these in load statement -&amp;nbsp;$(vSelectMeasure),$(=vSelectMeasure)&lt;/P&gt;
&lt;P&gt;I am trying to fetch minimum string of sales i,e; 150 by resolving the defined variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let vSelectMeasure ='=MinString(Sales)';&lt;/P&gt;
&lt;P&gt;MyTable1:&amp;nbsp;&lt;BR /&gt;Load *,'$(vSelectMeasure)',$(vSelectMeasure),$(=vSelectMeasure);&lt;BR /&gt;Load * inline [&lt;BR /&gt;Dim, Sales&lt;BR /&gt;A, 150&lt;BR /&gt;A, 200&lt;BR /&gt;B, 240&lt;BR /&gt;B, 230&lt;BR /&gt;C, 410&lt;BR /&gt;C, 330 ];&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You are not the first, who fell into the famous "delayed expansion trap" (and you won't be the last).&lt;/P&gt;
&lt;P&gt;You need delayed expansion if you want to use a variable, that you changed in the same block (a block is a series of commands within parentheses (and )).&lt;/P&gt;
&lt;P&gt;Delayed variables are referenced with !var! instead of %var%.&lt;/P&gt;
&lt;P&gt;Reason is the way, cmd parses the code. A complete line or block is parsed at once, replacing normal variables with their value at parse time. Delayed variables are evaluated at runtime.&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 03:56:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/variable-not-resolving-as-expected/m-p/1925007#M1218740</guid>
      <dc:creator>Davis69</dc:creator>
      <dc:date>2022-05-03T03:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: variable not resolving as expected</title>
      <link>https://community.qlik.com/t5/QlikView/variable-not-resolving-as-expected/m-p/1927150#M1218836</link>
      <description>&lt;P&gt;Hi Davis ,&lt;/P&gt;
&lt;P&gt;So what must be done&amp;nbsp; in my code to get the expected result as per delayed variable concept.&lt;/P&gt;
&lt;P&gt;I tried this&amp;nbsp;!$(vSelectMeasure)!&amp;nbsp; but, it did'nt work.&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 05:20:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/variable-not-resolving-as-expected/m-p/1927150#M1218836</guid>
      <dc:creator>srihitha</dc:creator>
      <dc:date>2022-05-06T05:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: variable not resolving as expected</title>
      <link>https://community.qlik.com/t5/QlikView/variable-not-resolving-as-expected/m-p/1927294#M1218847</link>
      <description>&lt;P&gt;It's not really clear what do you want to do. Within the script you need in each case a load to aggregate data, maybe something like:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;S&lt;/STRONG&gt;et vSelectMeasure = &lt;STRONG&gt;Min&lt;/STRONG&gt;(Sales);&lt;/P&gt;
&lt;P&gt;MyTable1:&amp;nbsp;&lt;BR /&gt;Load Dim, num#(Sales) as Sales inline [&lt;BR /&gt;Dim, Sales&lt;BR /&gt;A, 150&lt;BR /&gt;A, 200&lt;BR /&gt;B, 240&lt;BR /&gt;B, 230&lt;BR /&gt;C, 410&lt;BR /&gt;C, 330 ];&lt;/P&gt;
&lt;P&gt;MyTable2:&amp;nbsp;&lt;BR /&gt;load Dim, $(vSelectMeasure) as MinSales&lt;BR /&gt;resident&amp;nbsp;MyTable1&lt;BR /&gt;&lt;STRONG&gt;group by Dim&lt;/STRONG&gt;;&lt;/P&gt;
&lt;P&gt;The benefit of the variable seems to be limited in a similar use-case ...&lt;/P&gt;
&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 11:11:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/variable-not-resolving-as-expected/m-p/1927294#M1218847</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-05-06T11:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: variable not resolving as expected</title>
      <link>https://community.qlik.com/t5/QlikView/variable-not-resolving-as-expected/m-p/1927335#M1218849</link>
      <description>&lt;P&gt;Hi Marcus ,&lt;/P&gt;
&lt;P&gt;I just want to understand why below statement is not working in Mytable1.Should I always call a variable only inside resident table?&lt;/P&gt;
&lt;P&gt;//Load Dim,$(vSelectMeasure) group by Dim;&lt;/P&gt;
&lt;P&gt;Let vSelectMeasure ='=MinString(Sales)';&lt;BR /&gt;MyTable1: &lt;BR /&gt;Load Dim,$(vSelectMeasure) group by Dim;&lt;BR /&gt;Load * inline [&lt;BR /&gt;Dim, Sales&lt;BR /&gt;A, 150&lt;BR /&gt;A, 200&lt;BR /&gt;B, 240&lt;BR /&gt;B, 230&lt;BR /&gt;C, 410&lt;BR /&gt;C, 330 ];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 12:49:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/variable-not-resolving-as-expected/m-p/1927335#M1218849</guid>
      <dc:creator>srihitha</dc:creator>
      <dc:date>2022-05-06T12:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: variable not resolving as expected</title>
      <link>https://community.qlik.com/t5/QlikView/variable-not-resolving-as-expected/m-p/1927396#M1218852</link>
      <description>&lt;P&gt;By variables it depends how they are defined + where are they called + what contained the variable to which has the syntax to look like that they are working.&lt;/P&gt;
&lt;P&gt;In the script is no possibility to aggregate loaded values outside from a load. And within the load there are only listings of fields and/or functions allowed but no '=' which caused your load-error.&lt;/P&gt;
&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 14:46:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/variable-not-resolving-as-expected/m-p/1927396#M1218852</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2022-05-06T14:46:14Z</dc:date>
    </item>
  </channel>
</rss>

