<?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: Trying to put Expressions into Variables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Trying-to-put-Expressions-into-Variables/m-p/31713#M791155</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Finally got it working, based on a previous post in the Community by Sunny Talwar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LET etCurrentYear='sum({$' &amp;amp; '&amp;lt;@Year={$&lt;SPAN style="color: #575757;"&gt;' &amp;amp; '&lt;/SPAN&gt;(=(@Year))},@Quarter = ,@Period = ,@Week = &amp;gt;}#InvoiceTotal)' ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LET eLastYear='sum({$' &amp;amp; '&amp;lt;@Year={$' &amp;amp; '(=(@Year)-1)},@Quarter = ,@Period = ,@Week = &amp;gt;}#InvoiceTotal@)' ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just needed the ' &amp;amp; ' after the $ signs. It now works as expected.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Feb 2018 12:33:06 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-02-01T12:33:06Z</dc:date>
    <item>
      <title>Trying to put Expressions into Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Trying-to-put-Expressions-into-Variables/m-p/31712#M791154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a number of expressions in my document that I am using repeatedly, so I wanted to load them into variables.&lt;/P&gt;&lt;P&gt;First I defined them in the document using the Variable Overview and that works perfectly.&lt;/P&gt;&lt;P&gt;Best practices recommends loading them in the script, so I attempted to do that, but have had no luck getting it to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what &lt;SPAN style="font-size: 13.3333px;"&gt;Variable Overview &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;shows&lt;/SPAN&gt; if I define it in the document:&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-family: 'courier new', courier;"&gt;eCurrentYear = sum({$&amp;lt;@Year={$(=(@Year))},@Quarter = ,@Period = ,@Week = &amp;gt;}#InvoiceTotal) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; eLastYear = sum({$&amp;lt;@Year={$(=(@Year)-1)},@Quarter = ,@Period = ,@Week = &amp;gt;}#InvoiceTotal)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Life is good!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;This is what &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Variable Overview &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;shows&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; if I define it in the script:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; &lt;SPAN style="font-family: 'courier new', courier;"&gt;eCurrentYear = sum({$&amp;lt;@Year={(&lt;SPAN style="color: #ff0000; font-family: 'courier new', courier; font-size: 13.3333px;"&gt;internal error&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 13.3333px;"&gt;)},@Quarter = ,@Period = ,@Week = &amp;gt;}#InvoiceTotal)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'courier new', courier;"&gt; eLastYear = sum({$&amp;lt;@Year={(&lt;SPAN style="color: #ff0000;"&gt;internal error&lt;/SPAN&gt;)},@Quarter = ,@Period = ,@Week = &amp;gt;}#InvoiceTotal)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Does anybody have any idea what's causing the internal error, and how to get around it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trying-to-put-Expressions-into-Variables/m-p/31712#M791154</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to put Expressions into Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Trying-to-put-Expressions-into-Variables/m-p/31713#M791155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Finally got it working, based on a previous post in the Community by Sunny Talwar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LET etCurrentYear='sum({$' &amp;amp; '&amp;lt;@Year={$&lt;SPAN style="color: #575757;"&gt;' &amp;amp; '&lt;/SPAN&gt;(=(@Year))},@Quarter = ,@Period = ,@Week = &amp;gt;}#InvoiceTotal)' ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LET eLastYear='sum({$' &amp;amp; '&amp;lt;@Year={$' &amp;amp; '(=(@Year)-1)},@Quarter = ,@Period = ,@Week = &amp;gt;}#InvoiceTotal@)' ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just needed the ' &amp;amp; ' after the $ signs. It now works as expected.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Feb 2018 12:33:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trying-to-put-Expressions-into-Variables/m-p/31713#M791155</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-01T12:33:06Z</dc:date>
    </item>
  </channel>
</rss>

