<?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 Problems when reading in the variables from file in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problems-when-reading-in-the-variables-from-file/m-p/372730#M138591</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply. I changed the script like this and I get an "Script error" when reloading.Script editor shows that there are something wrong with the last LET's set analysis (it doesn't undestand the character '{')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Mar 2012 07:15:20 GMT</pubDate>
    <dc:creator>Teppo_Ojala</dc:creator>
    <dc:date>2012-03-28T07:15:20Z</dc:date>
    <item>
      <title>Problems when reading in the variables from file</title>
      <link>https://community.qlik.com/t5/QlikView/Problems-when-reading-in-the-variables-from-file/m-p/372728#M138589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a customer, who has lots of expressions in qvw file and then they have about 5 different qvw per this topic. So I thought to make one txt file about expressions and then I will read that into each of these qvw's.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I have a problem. I made a very simple qvw about this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached qvw includes this script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET vv_max_year=max(Year);&lt;/P&gt;&lt;P&gt;LET v_max_year='='&amp;amp;vv_max_year;&lt;/P&gt;&lt;P&gt;SET v_sum_max_year =&amp;nbsp; num(sum({$&amp;lt;Year={'$(v_max_year)'}&amp;gt;} sum_field)/1000, '# ##0');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My idea is that at the final result I have a variable called v_sum_max_year, which value is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;num(sum({$&amp;lt;Year={'$(v_max_year)'}&amp;gt;} sum_field)/1000, '# ##0');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, after reload the value is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;num(sum({$&amp;lt;Year={'=max(Year)'}&amp;gt;} sum_field)/1000, '# ##0')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script replaces the $(v_max_year) with a value of that variable. This sounds good, but this doesn't work. Is there a possibility to write the this so that script wouldn't replace $(var) with a value where we reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These SET's and LET's are definitely not my best knowledge area at QlikVIew &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2012 06:21:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problems-when-reading-in-the-variables-from-file/m-p/372728#M138589</guid>
      <dc:creator>Teppo_Ojala</dc:creator>
      <dc:date>2012-03-28T06:21:02Z</dc:date>
    </item>
    <item>
      <title>Problems when reading in the variables from file</title>
      <link>https://community.qlik.com/t5/QlikView/Problems-when-reading-in-the-variables-from-file/m-p/372729#M138590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi TOA,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are using LET and SET the other way around. &lt;/P&gt;&lt;P&gt;SET will set a string value to a variable. For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET x = 3+4; --&amp;gt; in this case the valuo of x $(x) is '3+4'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now if we use LET, the expression 3+4 will be evaluated:&lt;/P&gt;&lt;P&gt;LET y = 3+4;&amp;nbsp; in this case the value of y $(y) will be 7.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in your script change it soit looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;LET vv_max_year=max(Year);&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;SET v_max_year='='&amp;amp;vv_max_year;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;LET v_sum_max_year =&amp;nbsp; num(sum({$&amp;lt;Year={'$(v_max_year)'}&amp;gt;} sum_field)/1000, '# ##0');&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2012 07:12:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problems-when-reading-in-the-variables-from-file/m-p/372729#M138590</guid>
      <dc:creator>jvitantonio</dc:creator>
      <dc:date>2012-03-28T07:12:05Z</dc:date>
    </item>
    <item>
      <title>Problems when reading in the variables from file</title>
      <link>https://community.qlik.com/t5/QlikView/Problems-when-reading-in-the-variables-from-file/m-p/372730#M138591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply. I changed the script like this and I get an "Script error" when reloading.Script editor shows that there are something wrong with the last LET's set analysis (it doesn't undestand the character '{')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2012 07:15:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problems-when-reading-in-the-variables-from-file/m-p/372730#M138591</guid>
      <dc:creator>Teppo_Ojala</dc:creator>
      <dc:date>2012-03-28T07:15:20Z</dc:date>
    </item>
  </channel>
</rss>

