<?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 Wrong values using Flags in Sum Expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Wrong-values-using-Flags-in-Sum-Expression/m-p/228608#M80617</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oleg's answer is the most advisable to do, but you can also use the next expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;B&gt;SUM&lt;/B&gt;({$&amp;lt;&lt;B&gt;AnoCorrente&lt;/B&gt;={1}&amp;gt;}&lt;B&gt;[MetaR R$ Fat Bruto]&lt;/B&gt;)/ 1000&lt;/P&gt;&lt;P&gt;It returns the same numbers as the expresion without AnoCorrente&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Apr 2011 16:21:04 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-04-25T16:21:04Z</dc:date>
    <item>
      <title>Wrong values using Flags in Sum Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Wrong-values-using-Flags-in-Sum-Expression/m-p/228606#M80615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm developing an application witch values of 'Venda' and 'MetaR'. All values are from 2011, but soon I'll have from others years too.&lt;/P&gt;&lt;P&gt;I have a flag, 'AnoCorrente', to use inside the Sum expressions, to set only the values of the current year.&lt;/P&gt;&lt;P&gt;In the sum of 'Vendas', works fine, but in the Sum of 'MetaR', the values are unreallistic.&lt;/P&gt;&lt;P&gt;The expressions are:&lt;/P&gt;&lt;P&gt;=sum(AnoCorrente*[Venda R$ Fat Bruto])/1000&lt;/P&gt;&lt;P&gt;=sum(AnoCorrente*[MetaR R$ Fat Bruto])/1000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas of how to solve this problem ?&lt;/P&gt;&lt;P&gt;I've attached a file to show the issue.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Apr 2011 15:51:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Wrong-values-using-Flags-in-Sum-Expression/m-p/228606#M80615</guid>
      <dc:creator />
      <dc:date>2011-04-25T15:51:52Z</dc:date>
    </item>
    <item>
      <title>Wrong values using Flags in Sum Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Wrong-values-using-Flags-in-Sum-Expression/m-p/228607#M80616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe the problem is hidden in the data structure. You load 3 source data tables with numerous identical fields, into 3 separate tables. QlikView links the tables, generating 3 Synthetic keys. Your Flag is one of those identical fields, that become a key field.&lt;/P&gt;&lt;P&gt;I believe that if you concatenated all 3 tables into one, you'd get correct results and eliminate the need in 3 synthetic keys. So, try this:&lt;/P&gt;&lt;P&gt;DataTable:&lt;/P&gt;&lt;P&gt;LOAD .....&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;CONCATENATE (Data Table)&lt;/P&gt;&lt;P&gt;LOAD .....&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Apr 2011 15:58:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Wrong-values-using-Flags-in-Sum-Expression/m-p/228607#M80616</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2011-04-25T15:58:40Z</dc:date>
    </item>
    <item>
      <title>Wrong values using Flags in Sum Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Wrong-values-using-Flags-in-Sum-Expression/m-p/228608#M80617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oleg's answer is the most advisable to do, but you can also use the next expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;B&gt;SUM&lt;/B&gt;({$&amp;lt;&lt;B&gt;AnoCorrente&lt;/B&gt;={1}&amp;gt;}&lt;B&gt;[MetaR R$ Fat Bruto]&lt;/B&gt;)/ 1000&lt;/P&gt;&lt;P&gt;It returns the same numbers as the expresion without AnoCorrente&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Apr 2011 16:21:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Wrong-values-using-Flags-in-Sum-Expression/m-p/228608#M80617</guid>
      <dc:creator />
      <dc:date>2011-04-25T16:21:04Z</dc:date>
    </item>
    <item>
      <title>Wrong values using Flags in Sum Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Wrong-values-using-Flags-in-Sum-Expression/m-p/228609#M80618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi could you explain the code {$&amp;lt;&lt;B&gt;AnoCorrente&lt;/B&gt;={1}&amp;gt;} a little bit? what's $ here for?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Apr 2011 17:13:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Wrong-values-using-Flags-in-Sum-Expression/m-p/228609#M80618</guid>
      <dc:creator />
      <dc:date>2011-04-25T17:13:29Z</dc:date>
    </item>
    <item>
      <title>Wrong values using Flags in Sum Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Wrong-values-using-Flags-in-Sum-Expression/m-p/228610#M80619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks ! It works !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot use Oleg's Solution, because other requirements, but this works just fine.&lt;/P&gt;&lt;P&gt;Thank you all, people!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Apr 2011 17:26:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Wrong-values-using-Flags-in-Sum-Expression/m-p/228610#M80619</guid>
      <dc:creator />
      <dc:date>2011-04-25T17:26:28Z</dc:date>
    </item>
  </channel>
</rss>

