<?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 Trouble referencing variables in set analysis within load script variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Trouble-referencing-variables-in-set-analysis-within-load-script/m-p/1006637#M341868</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I recently asked a similar question and got a great answer, but this one is a little more complex.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to define a lot of variables in the load script because I need to be able to easily transfer them into other applications I am working on. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the definition of some variables I will reference. These all work as intended.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="onlyexample.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/102411_onlyexample.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;This set analysis works in a text box&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Only({1&amp;lt;SalesPerson={'$(vNameRetrieval)'}&amp;gt;*&amp;lt;myDisplayQtr={'$(vDisplayQTR)'}&amp;gt;}LeagueOfLeagues.RankPercentage)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only way I can get variables to work in set theory is by using&amp;nbsp; {"$(variablehere )"} wrapped around them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Here is my problem&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I write this in load script &lt;/P&gt;&lt;P&gt;&lt;IMG alt="loadscript.png" class="jive-image image-2" height="28" src="https://community.qlik.com/legacyfs/online/102412_loadscript.png" style="height: 28px; width: 826.667px;" width="827" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It shows variable contents where variable names should be in variable overview:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="variablecontents.png" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/102419_variablecontents.png" style="height: 38px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which&amp;nbsp; returns - because Only(Only()) never seems to work. It needs to come out with the inner variable names there instead of their contents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried lots of different combinations of "s and 's and also tried removing $() from around the variables in the load script but then the set analysis refuses to work because it no longer recognises my input as a variable name:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="attempts.png" class="image-4 jive-image" height="89" src="https://community.qlik.com/legacyfs/online/102420_attempts.png" style="height: 89px; width: 735.733px;" width="736" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Oct 2015 10:46:16 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-10-19T10:46:16Z</dc:date>
    <item>
      <title>Trouble referencing variables in set analysis within load script variable</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-referencing-variables-in-set-analysis-within-load-script/m-p/1006637#M341868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I recently asked a similar question and got a great answer, but this one is a little more complex.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to define a lot of variables in the load script because I need to be able to easily transfer them into other applications I am working on. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the definition of some variables I will reference. These all work as intended.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="onlyexample.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/102411_onlyexample.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;This set analysis works in a text box&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Only({1&amp;lt;SalesPerson={'$(vNameRetrieval)'}&amp;gt;*&amp;lt;myDisplayQtr={'$(vDisplayQTR)'}&amp;gt;}LeagueOfLeagues.RankPercentage)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only way I can get variables to work in set theory is by using&amp;nbsp; {"$(variablehere )"} wrapped around them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Here is my problem&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I write this in load script &lt;/P&gt;&lt;P&gt;&lt;IMG alt="loadscript.png" class="jive-image image-2" height="28" src="https://community.qlik.com/legacyfs/online/102412_loadscript.png" style="height: 28px; width: 826.667px;" width="827" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It shows variable contents where variable names should be in variable overview:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="variablecontents.png" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/102419_variablecontents.png" style="height: 38px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which&amp;nbsp; returns - because Only(Only()) never seems to work. It needs to come out with the inner variable names there instead of their contents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried lots of different combinations of "s and 's and also tried removing $() from around the variables in the load script but then the set analysis refuses to work because it no longer recognises my input as a variable name:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="attempts.png" class="image-4 jive-image" height="89" src="https://community.qlik.com/legacyfs/online/102420_attempts.png" style="height: 89px; width: 735.733px;" width="736" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Oct 2015 10:46:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-referencing-variables-in-set-analysis-within-load-script/m-p/1006637#M341868</guid>
      <dc:creator />
      <dc:date>2015-10-19T10:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble referencing variables in set analysis within load script variable</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-referencing-variables-in-set-analysis-within-load-script/m-p/1006638#M341869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The script will also try to evaluate $(...) constructs. Since set analysis doesn't work in the script you get things that don't work. The workaround goes like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;SET vMyVar =Only({1&amp;lt;SalesPerson={'@(vNameRetrieval)'}&amp;gt;*&amp;lt;myDisplayQtr={'@(vDisplayQTR)'}&amp;gt;}LeagueOfLeagues.RankPercentage);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;LET vMyVar =replace('$(vMyVar)','@','$');&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Oct 2015 12:22:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-referencing-variables-in-set-analysis-within-load-script/m-p/1006638#M341869</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-10-23T12:22:20Z</dc:date>
    </item>
  </channel>
</rss>

