<?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: Condition sum in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Condition-sum/m-p/246225#M586124</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Dihui,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the following expression, that should sum the values in Num where the Name is in Tab1 but not in Tab2, using set analysis&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({&amp;lt; Name = P({&amp;lt; Tab = {'Tab1'} &amp;gt;}), Name = E({&amp;lt; Tab = {'Tab2'} &amp;gt;}) &amp;gt;} Num)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&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, 01 Jul 2011 08:17:49 GMT</pubDate>
    <dc:creator>Miguel_Angel_Baeyens</dc:creator>
    <dc:date>2011-07-01T08:17:49Z</dc:date>
    <item>
      <title>Condition sum</title>
      <link>https://community.qlik.com/t5/QlikView/Condition-sum/m-p/246220#M586118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any one can help me out of this question:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say I have a table like this:&lt;/P&gt;&lt;P&gt;LOAD * INLINE[Tab,Name,Num&lt;/P&gt;&lt;P&gt;Tab1,A,1&lt;/P&gt;&lt;P&gt;Tab1,B,2&lt;/P&gt;&lt;P&gt;Tab2,A,3&lt;/P&gt;&lt;P&gt;Tab2,C,4];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need a pivot table like this:&lt;/P&gt;&lt;P&gt;dimension Name&lt;/P&gt;&lt;P&gt;expression:&lt;/P&gt;&lt;P&gt;if Name in Tab1 and not in Tab2 , calculate sum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so the pivot table is :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Name Num&lt;/P&gt;&lt;P&gt;A 0&lt;/P&gt;&lt;P&gt;B 2&lt;/P&gt;&lt;P&gt;C 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dihui&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2011 14:04:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Condition-sum/m-p/246220#M586118</guid>
      <dc:creator />
      <dc:date>2011-06-30T14:04:07Z</dc:date>
    </item>
    <item>
      <title>Condition sum</title>
      <link>https://community.qlik.com/t5/QlikView/Condition-sum/m-p/246221#M586119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The obvious answer is to try using set expressions i.e. sum({$&amp;lt;Tab={Tab1}&amp;gt;}Num). But maybe your example data is oversimplifying this. The set expression will just given sum where Tab in in the set of values {Tab1}. Your sampel results don't seem to match the expression you have given as the sum for A would be 1?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2011 14:51:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Condition-sum/m-p/246221#M586119</guid>
      <dc:creator />
      <dc:date>2011-06-30T14:51:25Z</dc:date>
    </item>
    <item>
      <title>Condition sum</title>
      <link>https://community.qlik.com/t5/QlikView/Condition-sum/m-p/246222#M586120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your answer ajohnson,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but you are not answering my question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A is in Tab1 and also in Tab2, so not calculated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2011 15:16:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Condition-sum/m-p/246222#M586120</guid>
      <dc:creator />
      <dc:date>2011-06-30T15:16:34Z</dc:date>
    </item>
    <item>
      <title>Condition sum</title>
      <link>https://community.qlik.com/t5/QlikView/Condition-sum/m-p/246223#M586121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; This is pretty ugly but works! Add two expressions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; if(index(concat(Tab),'Tab2')=0,sum(Num),0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concat(Tab)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 1st expression concatenates all of the Tab values for a name (e.g. for A = 'Tab1Tab2') and then uses index(,'Tab2')=0 as the condition to return 0 if Tab2 appears in the string.&lt;/P&gt;&lt;P&gt;The second expression ensures that you get a row for each name in your table. You can hide the second expression for the table by setting 'Hide Column' in the presentation tab.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2011 16:25:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Condition-sum/m-p/246223#M586121</guid>
      <dc:creator />
      <dc:date>2011-06-30T16:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Condition sum</title>
      <link>https://community.qlik.com/t5/QlikView/Condition-sum/m-p/246224#M586122</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;&amp;nbsp;&amp;nbsp; Have a look at this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I hope this is what you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Find the attachment.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kaushik Solanki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2011 07:29:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Condition-sum/m-p/246224#M586122</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2011-07-01T07:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: Condition sum</title>
      <link>https://community.qlik.com/t5/QlikView/Condition-sum/m-p/246225#M586124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Dihui,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the following expression, that should sum the values in Num where the Name is in Tab1 but not in Tab2, using set analysis&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({&amp;lt; Name = P({&amp;lt; Tab = {'Tab1'} &amp;gt;}), Name = E({&amp;lt; Tab = {'Tab2'} &amp;gt;}) &amp;gt;} Num)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&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, 01 Jul 2011 08:17:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Condition-sum/m-p/246225#M586124</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-07-01T08:17:49Z</dc:date>
    </item>
  </channel>
</rss>

