<?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: Why variable with formula in script don't have the value , but the formula? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Why-variable-with-formula-in-script-don-t-have-the-value-but-the/m-p/416315#M154770</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, I see what you're trying to do, ie using chart functions in the script. GetFieldSelections cannot be used in the script. Selections aren't available in the script. You could store them in a variable first I think, but you can't use chart functions in the script afaik. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Nov 2012 14:10:08 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2012-11-08T14:10:08Z</dc:date>
    <item>
      <title>Why variable with formula in script don't have the value , but the formula?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-variable-with-formula-in-script-don-t-have-the-value-but-the/m-p/416312#M154767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have this little question...probably i wrong something...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-i set in my sheet a variable in this way :&lt;/P&gt;&lt;P&gt;var1=GetFieldSelections(dbName)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-when i select a value in an object, in the sheet this variable is set to the value that i select , but&amp;nbsp; &lt;/P&gt;&lt;P&gt;when i try to use this variable in the load script i found this with the value of the formula and not with the right value .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EX:&lt;/P&gt;&lt;P&gt;if i select in my object a field with value of "mydb" in the sheet the variable have value = mydb but in the script the value of the var is "GetFieldSelections(dbName)"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why ? what's wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to use macro to convert into another variable the text value of my var1 and use the new var in the script!!!! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;thank everyone and sorry for my english.&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;Wava&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2012 13:44:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-variable-with-formula-in-script-don-t-have-the-value-but-the/m-p/416312#M154767</guid>
      <dc:creator />
      <dc:date>2012-11-08T13:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: Why variable with formula in script don't have the value , but the formula?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-variable-with-formula-in-script-don-t-have-the-value-but-the/m-p/416313#M154768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You probably didn't define the variable correctly or need to use the right $-expansion. See &lt;A _jive_internal="true" href="https://community.qlik.com/message/274604#274604"&gt;here&lt;/A&gt; for the different ways variables can be defined and used.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2012 13:47:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-variable-with-formula-in-script-don-t-have-the-value-but-the/m-p/416313#M154768</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-11-08T13:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: Why variable with formula in script don't have the value , but the formula?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-variable-with-formula-in-script-don-t-have-the-value-but-the/m-p/416314#M154769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No i think that i define the variable correctly in the sheet:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;var1=GetFieldSelections(dbName)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;and use the $var1 to read the value in my script , but i found the formula and not the value .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;If in my sheet i set the variable this a costant value :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;var1='my value'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;and use the $var1 &lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;to read the value in my script&lt;/SPAN&gt; it's work fine!!!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Why with the constant work , but not with the formula?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2012 13:55:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-variable-with-formula-in-script-don-t-have-the-value-but-the/m-p/416314#M154769</guid>
      <dc:creator />
      <dc:date>2012-11-08T13:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Why variable with formula in script don't have the value , but the formula?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-variable-with-formula-in-script-don-t-have-the-value-but-the/m-p/416315#M154770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, I see what you're trying to do, ie using chart functions in the script. GetFieldSelections cannot be used in the script. Selections aren't available in the script. You could store them in a variable first I think, but you can't use chart functions in the script afaik. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2012 14:10:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-variable-with-formula-in-script-don-t-have-the-value-but-the/m-p/416315#M154770</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-11-08T14:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: Why variable with formula in script don't have the value , but the formula?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-variable-with-formula-in-script-don-t-have-the-value-but-the/m-p/416316#M154771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I understand , but i don't find a function to save the &lt;STRONG&gt;value &lt;/STRONG&gt;of my var in an other var .&lt;/P&gt;&lt;P&gt;If i set&amp;nbsp; var2=var1 in my sheet , in the script i have the same problem , the value of var2 in the script is "=var1".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EX:&lt;/P&gt;&lt;P&gt;if var1=&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;GetFieldSelections(myfield) and myfield value is "Qlik" and i want in var2 the constant "qlik"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only way to do this that i found is use macro but it sound a little crazy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;does not exist another way?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank&lt;/P&gt;&lt;P&gt;Wava&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2012 14:22:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-variable-with-formula-in-script-don-t-have-the-value-but-the/m-p/416316#M154771</guid>
      <dc:creator />
      <dc:date>2012-11-08T14:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Why variable with formula in script don't have the value , but the formula?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-variable-with-formula-in-script-don-t-have-the-value-but-the/m-p/416317#M154772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you can use a trigger to set a variable with an action. If you set the value of the variable to =getfieldselections(myfield) then the variable will get as value a comma separated list of values instead of the unevaluated expression. Then you can use that variable in the script. LET varY = '$(varX)';&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2012 15:53:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-variable-with-formula-in-script-don-t-have-the-value-but-the/m-p/416317#M154772</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-11-08T15:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: Why variable with formula in script don't have the value , but the formula?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-variable-with-formula-in-script-don-t-have-the-value-but-the/m-p/416318#M154773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;no !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;using &lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;LET varY = '$(varX)';&lt;/SPAN&gt; in the script i have the formula not the value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank &lt;/P&gt;&lt;P&gt;wava&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2012 15:58:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-variable-with-formula-in-script-don-t-have-the-value-but-the/m-p/416318#M154773</guid>
      <dc:creator />
      <dc:date>2012-11-08T15:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: Why variable with formula in script don't have the value , but the formula?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-variable-with-formula-in-script-don-t-have-the-value-but-the/m-p/416319#M154774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes !! But you just don't understand how yet. See attached qvw. Change the selection, reload and check the values of the variables. var3 is set with a trigger, varX is set in the script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2012 17:21:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-variable-with-formula-in-script-don-t-have-the-value-but-the/m-p/416319#M154774</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-11-08T17:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: Why variable with formula in script don't have the value , but the formula?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-variable-with-formula-in-script-don-t-have-the-value-but-the/m-p/416320#M154775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are great!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The way is however strange , because from variable definition i can't do it and with trigger i can !!!&lt;/P&gt;&lt;P&gt;This way is better than use a macro to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank a lot for your answer &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bye&lt;/P&gt;&lt;P&gt;Wava&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2012 07:46:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-variable-with-formula-in-script-don-t-have-the-value-but-the/m-p/416320#M154775</guid>
      <dc:creator />
      <dc:date>2012-11-09T07:46:32Z</dc:date>
    </item>
  </channel>
</rss>

