<?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: Expression in variable not the same formula in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Expression-in-variable-not-the-same-formula/m-p/1798824#M64687</link>
    <description>&lt;P&gt;If you use =$(Variable) on a variable containing an equal sign such as =sum(territ), it will be evaluated first, outside the context of the object / row, and the result will be used in your formula.&lt;/P&gt;&lt;P&gt;You could try replacing your variable with Sum(territ) instead of =Sum(territ) and then =$(Test2) should evaluate within the context of the row. In the example here, I've got =Sum(id) as Test1 and Sum(id) as Test2&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Or_0-1618238634539.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/52831i0C90D0CFA45197AA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Or_0-1618238634539.png" alt="Or_0-1618238634539.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Apr 2021 14:44:09 GMT</pubDate>
    <dc:creator>Or</dc:creator>
    <dc:date>2021-04-12T14:44:09Z</dc:date>
    <item>
      <title>Expression in variable not the same formula</title>
      <link>https://community.qlik.com/t5/App-Development/Expression-in-variable-not-the-same-formula/m-p/1798807#M64680</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have some data like:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.PNG" style="width: 340px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/52823iC32F4C4C91A18CE5/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.PNG" alt="1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;My problem is that if I introduce my expresion directly in the table, it works well, but if I introduce the expression in a variable and use it as a measure in the table the result is not the same, it shows as total:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="2.PNG" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/52828iC745C85A09BC63B9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2.PNG" alt="2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Test2=sum(territ)&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 17:17:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Expression-in-variable-not-the-same-formula/m-p/1798807#M64680</guid>
      <dc:creator>Pedro_Rodriguez</dc:creator>
      <dc:date>2024-11-16T17:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: Expression in variable not the same formula</title>
      <link>https://community.qlik.com/t5/App-Development/Expression-in-variable-not-the-same-formula/m-p/1798824#M64687</link>
      <description>&lt;P&gt;If you use =$(Variable) on a variable containing an equal sign such as =sum(territ), it will be evaluated first, outside the context of the object / row, and the result will be used in your formula.&lt;/P&gt;&lt;P&gt;You could try replacing your variable with Sum(territ) instead of =Sum(territ) and then =$(Test2) should evaluate within the context of the row. In the example here, I've got =Sum(id) as Test1 and Sum(id) as Test2&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Or_0-1618238634539.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/52831i0C90D0CFA45197AA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Or_0-1618238634539.png" alt="Or_0-1618238634539.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 14:44:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Expression-in-variable-not-the-same-formula/m-p/1798824#M64687</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-04-12T14:44:09Z</dc:date>
    </item>
  </channel>
</rss>

