<?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 Set Analysis Qurey in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Qurey/m-p/265120#M99654</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;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; How do i write the below IF condtion in Set Analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum(If(Quantity=[Invoiced Quantity],Cost_Amount,If(Quantity&amp;lt;&amp;gt;[Invoiced Quantity],Cost_Amount + [Cost Amount (Expected)])))/100000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Antony.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Oct 2011 07:55:49 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-10-21T07:55:49Z</dc:date>
    <item>
      <title>Set Analysis Qurey</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Qurey/m-p/265120#M99654</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;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; How do i write the below IF condtion in Set Analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum(If(Quantity=[Invoiced Quantity],Cost_Amount,If(Quantity&amp;lt;&amp;gt;[Invoiced Quantity],Cost_Amount + [Cost Amount (Expected)])))/100000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Antony.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Oct 2011 07:55:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Qurey/m-p/265120#M99654</guid>
      <dc:creator />
      <dc:date>2011-10-21T07:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Qurey</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Qurey/m-p/265121#M99655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Antony,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You cannot do that since the sum depends on the condition to use one field or another, actually you are using nested If(). Set analysis does not replace all kind of conditionals. Set analysis is just a way of fast filtering of data, returning a smaller subset than the set used by the whole document, that it does not seem to be the case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I rather do that If() in the script, so you always Sum() up the same fieldand the chart will render faster:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;If(Quantity = [Invoiced Quantity], Cost_Amount, If(Quantity &amp;lt;&amp;gt; [Invoiced Quantity], Cost_Amount + [Cost Amount (Expected)])) / 100000 AS CostToSum,&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Being in addition your expression simpler:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Sum(CostToSum)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Further discussions on how the set analysis is not a substitute for If() and that it is evaluated once and for the whole chart can be found in &lt;A _jive_internal="true" href="https://community.qlik.com/docs/DOC-1335"&gt;this doc&lt;/A&gt; and in &lt;A _jive_internal="true" href="https://community.qlik.com/thread/13192"&gt;this thread&lt;/A&gt; that are worth reading.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that makes sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Oct 2011 08:18:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Qurey/m-p/265121#M99655</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-10-21T08:18:03Z</dc:date>
    </item>
    <item>
      <title>Set Analysis Qurey</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Qurey/m-p/265122#M99656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Miguel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thanks for your reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Oct 2011 08:45:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Qurey/m-p/265122#M99656</guid>
      <dc:creator />
      <dc:date>2011-10-21T08:45:31Z</dc:date>
    </item>
  </channel>
</rss>

