<?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 Variables with expressions in load script? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Variables-with-expressions-in-load-script/m-p/224556#M76946</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a variable defined in the document properties with the following value, which gets the value of the selected ReportName and is used in a show Condition.&lt;/P&gt;&lt;P&gt;=FIELDVALUE('ReportName',FieldIndex('ReportName',GetFieldSelections(ReportName)))&lt;/P&gt;&lt;P&gt;I tried to move this to the load script but it fails on the 'GetFieldSelections' function.&lt;/P&gt;&lt;P&gt;I read some other posts and it seems as though I need to do a set analysis but dont really understand how to actually do this.&lt;/P&gt;&lt;P&gt;Can anyone help me with this? Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Jan 2010 16:25:46 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-01-27T16:25:46Z</dc:date>
    <item>
      <title>Variables with expressions in load script?</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-with-expressions-in-load-script/m-p/224556#M76946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a variable defined in the document properties with the following value, which gets the value of the selected ReportName and is used in a show Condition.&lt;/P&gt;&lt;P&gt;=FIELDVALUE('ReportName',FieldIndex('ReportName',GetFieldSelections(ReportName)))&lt;/P&gt;&lt;P&gt;I tried to move this to the load script but it fails on the 'GetFieldSelections' function.&lt;/P&gt;&lt;P&gt;I read some other posts and it seems as though I need to do a set analysis but dont really understand how to actually do this.&lt;/P&gt;&lt;P&gt;Can anyone help me with this? Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jan 2010 16:25:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-with-expressions-in-load-script/m-p/224556#M76946</guid>
      <dc:creator />
      <dc:date>2010-01-27T16:25:46Z</dc:date>
    </item>
    <item>
      <title>Variables with expressions in load script?</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-with-expressions-in-load-script/m-p/224557#M76947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How are you defining the variable in the Load Script?&lt;/P&gt;&lt;P&gt;If you use:&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Let vVariable = FIELDVALUE('ReportName',FieldIndex('ReportName',GetFieldSelections(ReportName)))&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;It should give you the same result as if you defined the variable manually in document properties. "Let" is the key when you have a variable that is an expression and you don't want it to be evaluated at runtime.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jan 2010 16:38:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-with-expressions-in-load-script/m-p/224557#M76947</guid>
      <dc:creator />
      <dc:date>2010-01-27T16:38:22Z</dc:date>
    </item>
    <item>
      <title>Variables with expressions in load script?</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-with-expressions-in-load-script/m-p/224558#M76948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes,&lt;/P&gt;&lt;P&gt;Thats what I had. ReportName is a table built as inline and is defined before this variable. I dont know if that helps.&lt;/P&gt;&lt;P&gt;Here is the error I get when I try to 'reload' the script.&lt;/P&gt;&lt;P&gt;Error in expression:&lt;BR /&gt;GETFIELDSELECTIONS is not a valid function&lt;BR /&gt;&lt;BR /&gt;Let vVariable = FIELDVALUE('ReportName',FieldIndex('ReportName',GetFieldSelections(ReportName)))&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;SET ThousandSep=','&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jan 2010 17:32:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-with-expressions-in-load-script/m-p/224558#M76948</guid>
      <dc:creator />
      <dc:date>2010-01-27T17:32:30Z</dc:date>
    </item>
    <item>
      <title>Variables with expressions in load script?</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-with-expressions-in-load-script/m-p/224559#M76949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Set vVariable = "=FIELDVALUE('ReportName',FieldIndex('ReportName',GetFieldSelections(ReportName)))"&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;I think I misspoke about Let. It seems like you need to use Set here. Maybe Let does evaluate at run-time. Now I've confused myself. &lt;IMG alt="Big Smile" src="http://community.qlik.com/emoticons/emotion-2.gif" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jan 2010 18:07:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-with-expressions-in-load-script/m-p/224559#M76949</guid>
      <dc:creator />
      <dc:date>2010-01-27T18:07:07Z</dc:date>
    </item>
    <item>
      <title>Variables with expressions in load script?</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-with-expressions-in-load-script/m-p/224560#M76950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That worked to get the variable set to the that string representation of the expression that I want. Now the question is, how do I get that expression to evaluate?&lt;/P&gt;&lt;P&gt;Thank you again for all your help. This is definitely appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jan 2010 19:24:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-with-expressions-in-load-script/m-p/224560#M76950</guid>
      <dc:creator />
      <dc:date>2010-01-27T19:24:46Z</dc:date>
    </item>
    <item>
      <title>Variables with expressions in load script?</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-with-expressions-in-load-script/m-p/224561#M76951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;=vVariable as an expression. In some cases, you may need a dollar sign expansion: =$(vVariable)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jan 2010 19:52:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-with-expressions-in-load-script/m-p/224561#M76951</guid>
      <dc:creator />
      <dc:date>2010-01-27T19:52:54Z</dc:date>
    </item>
  </channel>
</rss>

