<?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: Difference between conditional sum with 'if' and with set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1039995#M922234</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think there should be any difference, but can you share an example where you are seeing different values?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Apr 2016 17:17:47 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-04-15T17:17:47Z</dc:date>
    <item>
      <title>Difference between conditional sum with 'if' and with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1039994#M922233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the difference between doing a conditional sum with "if" and with set analysis?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;In a bar chart I want to show a sum of the values (field: value) associated with men (field: sex). If I use "if" inside "sum", the value is different then using set analysis expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(if ([sex] = 'M', [value], 0));&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;[sex]={'M'}&amp;gt;} [value]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know that the performance of set analysis is better. The thing is that the result of the expressions are different (a big difference). I guess there are some problems with my model, but anyway I thought that those expressions would be equivalent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In other words, what is the difference between this two expression (besides performance)? or How can the results be different?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&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/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1039994#M922233</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between conditional sum with 'if' and with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1039995#M922234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think there should be any difference, but can you share an example where you are seeing different values?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Apr 2016 17:17:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1039995#M922234</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-04-15T17:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between conditional sum with 'if' and with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1039996#M922236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;.if use&amp;nbsp; iteration&lt;/P&gt;&lt;P&gt;set analsys&amp;nbsp; wit give direct result&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u can chk here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/message/992868"&gt;RE:Diference-Perfomance&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Apr 2016 17:21:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1039996#M922236</guid>
      <dc:creator>Chanty4u</dc:creator>
      <dc:date>2016-04-15T17:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between conditional sum with 'if' and with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1039997#M922238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The image below shows two text box with the expression used on the caption title. As anyone can see the results are different. &lt;/P&gt;&lt;P&gt;&lt;IMG alt="diferenca_sum.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/121861_diferenca_sum.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2016 12:21:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1039997#M922238</guid>
      <dc:creator />
      <dc:date>2016-04-18T12:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between conditional sum with 'if' and with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1039998#M922240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Chanty 4u,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The link that you provided guided me to this question which is still not answered:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/thread/47408"&gt;Difference between IF condition and Set analysis&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In there &lt;SPAN class="j-post-author"&gt;&lt;STRONG&gt;&lt;A href="https://community.qlik.com/people/perumal_41"&gt;perumal_41&lt;/A&gt; &lt;/STRONG&gt;said that "if Condition Some times return&amp;nbsp; Duplicate&amp;nbsp; value&amp;nbsp; and consume more memory" but I couldn't find why or when "sometimes return duplicates". I think it is important to know the mechanics behind this to avoid showing wrong values.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author"&gt;The performance issues I understand and it is not the point with my question.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2016 12:28:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1039998#M922240</guid>
      <dc:creator />
      <dc:date>2016-04-18T12:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between conditional sum with 'if' and with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1039999#M922242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you made selections in [Origem ....] field? That might cause differences as the set analysis will always include RGPS regardless of any selection in [Origem...] field, where as if will filter out the data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2016 14:41:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1039999#M922242</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-04-18T14:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between conditional sum with 'if' and with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040000#M922244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How are the two fields for value and origing related in your data model? Do they reside in the same or different tables?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The if() statement might force QV to create a temporary join between tables and this might lead to fact (value) duplication. All depends on your data model...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2016 14:56:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040000#M922244</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-04-18T14:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between conditional sum with 'if' and with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040001#M922246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the example there is no direct selection of [Origem ....]. But there is an indirect selection. If I clear all the selections the values are still different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In that state, if I select directely the value 'RGPS' for that field, the values did not change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I select a different value for that field then the sum with "if" is 0 (which is expected since no value associated with 'RGPS' is possible) and the sum with set analysis did not change. This corroborates with what you told that set analysis will always include RGPS regardless of any selection in that field. &lt;/P&gt;&lt;P&gt;And actually this is one difference between the two expressions!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But still no makes sense when there is no selection in that field. I tried selections in other fields associated with these values and they change the value of both expressions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2016 16:57:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040001#M922246</guid>
      <dc:creator />
      <dc:date>2016-04-18T16:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between conditional sum with 'if' and with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040002#M922248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you be able to share a sample where you can show this stuff going on?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2016 17:07:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040002#M922248</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-04-18T17:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between conditional sum with 'if' and with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040003#M922250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you are in the right direction. I believe there is some problem with my data model, but I still did not find. The value returned from the expression with set analysis seems the right result. Duplication of some values is the best shot! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The field "Origem..." came from the same table of the value calculated. But also the same field is used as an association (synthetic key, I know that I shall to remodel and remove the synthetic keys) with another table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The thing is that the two expressions are not equivalent! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;swuehl, can you provide an example when the if statement might duplicate the value? Just to understand that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2016 17:11:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040003#M922250</guid>
      <dc:creator />
      <dc:date>2016-04-18T17:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between conditional sum with 'if' and with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040004#M922252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;Key, Value&lt;/P&gt;&lt;P&gt;1, 100&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;Key, Flag&lt;/P&gt;&lt;P&gt;1, Blue&lt;/P&gt;&lt;P&gt;1, Blue&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum(If(Flag='Blue', Value))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum({&amp;lt;Flag = {Blue}&amp;gt;} Value)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2016 17:13:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040004#M922252</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-04-18T17:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between conditional sum with 'if' and with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040005#M922254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see it now &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2016 17:18:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040005#M922254</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-04-18T17:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between conditional sum with 'if' and with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040006#M922256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2016 17:22:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040006#M922256</guid>
      <dc:creator />
      <dc:date>2016-04-18T17:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between conditional sum with 'if' and with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040007#M922257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;swehl,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you understand why, if I add a new line to the first table of your example: &lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;Key, Value&lt;/P&gt;&lt;P&gt;1, 100&lt;/P&gt;&lt;P&gt;1, 25&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;Key, Value&lt;/P&gt;&lt;P&gt;1, 100&lt;/P&gt;&lt;P&gt;2, 25&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(without any changes to the second table) The duplication does not occur! I think I did not understand the "joins" behind these scenarios.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, in the same scenario with the tuple (2, 25), if I add a new line on the second table (2, Red) like below: &lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;Key, Value&lt;/P&gt;&lt;P&gt;1, 100&lt;/P&gt;&lt;P&gt;2, 25&lt;/P&gt;&lt;P&gt;]; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;Key, Flag&lt;/P&gt;&lt;P&gt;1, Blue&lt;/P&gt;&lt;P&gt;1, Blue&lt;/P&gt;&lt;P&gt;2, Red&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The duplication happens again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2016 17:50:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040007#M922257</guid>
      <dc:creator />
      <dc:date>2016-04-18T17:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between conditional sum with 'if' and with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040008#M922258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I still get Value duplication with your first two tables. Could you share your sample?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2016 18:06:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040008#M922258</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-04-18T18:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between conditional sum with 'if' and with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040009#M922259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sure,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I attached the qvw with three examples: the one that you showed at first (with duplication) and two other which the duplication is not shown. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2016 18:36:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040009#M922259</guid>
      <dc:creator />
      <dc:date>2016-04-18T18:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between conditional sum with 'if' and with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040010#M922260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, ok, you are doing the comparison / set analysis on the key field instead of flag field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2016 18:43:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040010#M922260</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-04-18T18:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between conditional sum with 'if' and with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040011#M922261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right, my mistake.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was adapting your example to my context which the conditional field is the key of the relationship.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but in this case (when using the key in the conditional expression), the behavior of Qlikview seems awkward to me. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2016 18:55:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040011#M922261</guid>
      <dc:creator />
      <dc:date>2016-04-18T18:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between conditional sum with 'if' and with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040012#M922262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So just to see if I understand what we think is going on, with the sum(if()), for every row in the field with the flag, it takes the key and looks up the value. Or equivalently, it does a join of the two tables, duplicating the value. So we get 200. With the second, it "selects" Blue, which means that the only possible value of key is 1, and therefore the only possible value of value is 100, so it returns 100. This is all roughly speaking.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2016 19:16:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040012#M922262</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2016-04-18T19:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between conditional sum with 'if' and with set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040013#M922263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right, I believe that's the basic working of QlikView aggregations, isn't it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Logical inference&lt;/P&gt;&lt;P&gt;2) Aggregation engine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See also&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/3214"&gt;Logical Inference and Aggregations&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/3238"&gt;The Calculation Engine&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w.r.t. André's latest sample: Do you need any more explanation here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe using a key value in the aggregation (example with if() ) is similar to performing a Count(KeyField), the results are not deterministic (or to use different view: It's not clear for QV how to perform the JOIN / Lookup (so one could say: Well, it's clear, use the records from the same table as Value, which should be the minimal number of records. I believe for QV it's not clear))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2016 19:49:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Difference-between-conditional-sum-with-if-and-with-set-analysis/m-p/1040013#M922263</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-04-18T19:49:10Z</dc:date>
    </item>
  </channel>
</rss>

