<?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: Conditional Sum in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Conditional-Sum/m-p/380448#M491426</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;If you use Aggr() inside a chart or table, then you must include all the table dimensions in the Aggr(). In your case, Add WorkType...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive-pre" style="font-size: 12px; margin: 10px 20px; padding-left: 10px; color: #636363;"&gt;&lt;P&gt;&lt;CODE class="jive-code jive-sql"&gt;&lt;SPAN class="jive-sql-keyword" style="color: navy; font-weight: bold;"&gt;sum&lt;/SPAN&gt; ( aggr( &lt;SPAN class="jive-sql-keyword" style="color: navy; font-weight: bold;"&gt;sum&lt;/SPAN&gt;(if(WorkType='B' &lt;SPAN class="jive-sql-keyword" style="color: navy; font-weight: bold;"&gt;or&lt;/SPAN&gt; WorkType='C' &lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code jive-sql"&gt;&lt;SPAN class="jive-sql-keyword" style="color: navy; font-weight: bold;"&gt;or&lt;/SPAN&gt; WorkType='D', Hours)),[Division-&amp;gt;Depart-&amp;gt;Employee], Worktype)) &lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code jive-sql"&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Aug 2012 14:51:15 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2012-08-23T14:51:15Z</dc:date>
    <item>
      <title>Conditional Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-Sum/m-p/380447#M491425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;I'm facing the follwing problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;I've &lt;/SPAN&gt;&lt;SPAN class="hps"&gt;a pivot table&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;with&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;two dimensions&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;WorkType&lt;/SPAN&gt;, &lt;SPAN class="hps atn"&gt;[&lt;/SPAN&gt;Division&lt;SPAN class="atn"&gt;-&lt;/SPAN&gt;&amp;gt; &lt;SPAN class="hps atn"&gt;Depart-&lt;/SPAN&gt;Employee]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;Worktype&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;as&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;column&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;Group&lt;/SPAN&gt; &lt;SPAN class="hps atn"&gt;[&lt;/SPAN&gt;Division&lt;SPAN class="atn"&gt;-&lt;/SPAN&gt;&amp;gt; &lt;SPAN class="hps atn"&gt;Depart-&lt;/SPAN&gt;Employee] &lt;SPAN class="hps"&gt;as lines&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;The metric&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;is hours of&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;work&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;I need to&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;create an expression&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;that sums&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;some types of&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;worktype&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;and&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;that its results&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;appear&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;in all columns&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps alt-edited"&gt;I built&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;the following expression&lt;/SPAN&gt;, &lt;SPAN class="hps"&gt;but the value&lt;/SPAN&gt; &lt;SPAN class="hps atn"&gt;(&lt;/SPAN&gt;although well &lt;SPAN class="hps"&gt;calculated)&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;only&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;appears for&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;the first&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;condition&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;worktype&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;instead&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;of repeating&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;in all columns&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13457316993236278" jivemacro_uid="_13457316993236278"&gt;&lt;P&gt;sum&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;( &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;( &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;WorkType&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;='B' &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;or&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;WorkType&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;='C' &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;or&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;WorkType&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;='D', &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Hours&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)),&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Division-&amp;gt;Depart-&amp;gt;Employee]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I solve this requirement ?&lt;/P&gt;&lt;P&gt;Help please&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Bruno &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2012 14:31:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-Sum/m-p/380447#M491425</guid>
      <dc:creator>bruno_m_santos</dc:creator>
      <dc:date>2012-08-23T14:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-Sum/m-p/380448#M491426</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;If you use Aggr() inside a chart or table, then you must include all the table dimensions in the Aggr(). In your case, Add WorkType...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive-pre" style="font-size: 12px; margin: 10px 20px; padding-left: 10px; color: #636363;"&gt;&lt;P&gt;&lt;CODE class="jive-code jive-sql"&gt;&lt;SPAN class="jive-sql-keyword" style="color: navy; font-weight: bold;"&gt;sum&lt;/SPAN&gt; ( aggr( &lt;SPAN class="jive-sql-keyword" style="color: navy; font-weight: bold;"&gt;sum&lt;/SPAN&gt;(if(WorkType='B' &lt;SPAN class="jive-sql-keyword" style="color: navy; font-weight: bold;"&gt;or&lt;/SPAN&gt; WorkType='C' &lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code jive-sql"&gt;&lt;SPAN class="jive-sql-keyword" style="color: navy; font-weight: bold;"&gt;or&lt;/SPAN&gt; WorkType='D', Hours)),[Division-&amp;gt;Depart-&amp;gt;Employee], Worktype)) &lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code jive-sql"&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2012 14:51:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-Sum/m-p/380448#M491426</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-08-23T14:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-Sum/m-p/380449#M491427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps alt-edited"&gt;Thanks your help&lt;/SPAN&gt;&lt;SPAN class="hps"&gt;, but&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;does not have the&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;expected behavior&lt;/SPAN&gt;...&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;The&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;need is&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;that&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;the sum&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;of the columns&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;(B, C&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;and D)&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;are&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;visible&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;in all columns.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;Is&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;just&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;adding&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;the corresponding value from&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;column.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;Bruno&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="20549" class="jive-image-thumbnail jive-image" onclick="" alt="image.jpg" src="https://community.qlik.com/legacyfs/online/20549_image.jpg" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2012 15:16:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-Sum/m-p/380449#M491427</guid>
      <dc:creator>bruno_m_santos</dc:creator>
      <dc:date>2012-08-23T15:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-Sum/m-p/380450#M491428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bruno&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume that Cond Sum is the expression with the problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need data from B, C and D to appear in each case, then try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive-pre" style="font-size: 12px; margin: 10px 20px; padding-left: 10px; color: #636363;"&gt;&lt;P&gt;&lt;CODE class="jive-code jive-sql"&gt;&lt;SPAN class="jive-sql-keyword" style="color: navy; font-weight: bold;"&gt;sum&lt;/SPAN&gt; ( aggr( &lt;SPAN class="jive-sql-keyword" style="color: navy; font-weight: bold;"&gt;sum&lt;/SPAN&gt;(Total &amp;lt;WorkType&amp;gt; if(WorkType='B' &lt;SPAN class="jive-sql-keyword" style="color: navy; font-weight: bold;"&gt;or&lt;/SPAN&gt; WorkType='C' &lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code jive-sql"&gt;&lt;SPAN class="jive-sql-keyword" style="color: navy; font-weight: bold;"&gt;or&lt;/SPAN&gt; WorkType='D', Hours)),[Division-&amp;gt;Depart-&amp;gt;Employee], Worktype)) &lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code jive-sql"&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 08:34:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-Sum/m-p/380450#M491428</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-08-24T08:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-Sum/m-p/380451#M491429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;I had to&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;change a little&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;because I wanted&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;to&lt;/SPAN&gt; &lt;SPAN class="hps alt-edited"&gt;sum&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;lines&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;and not&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;columns&lt;/SPAN&gt;, &lt;SPAN class="hps"&gt;but it worked&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;perfectly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;Thanks a lot&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Bruno&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13458227270064702" jivemacro_uid="_13458227270064702"&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="color: black;"&gt;( &lt;/SPAN&gt;&lt;SPAN style="color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue;"&gt;TOTAL&lt;/SPAN&gt;&lt;SPAN style="color: black;"&gt; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: maroon;"&gt;[Division-&amp;gt;Depart-&amp;gt;Employee]&lt;/SPAN&gt;&lt;SPAN style="color: black;"&gt;&amp;gt; if(&lt;/SPAN&gt;WorkType='B' &lt;SPAN class="jive-sql-keyword" style="color: navy; font-weight: bold;"&gt;or&lt;/SPAN&gt; WorkType='C' &lt;CODE class="jive-code jive-sql"&gt;&lt;SPAN class="jive-sql-keyword" style="color: navy; font-weight: bold;"&gt;or&lt;/SPAN&gt; WorkType='D'&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;CODE class="jive-code jive-sql"&gt;&lt;/CODE&gt;&lt;SPAN style="color: black;"&gt;, Hours,0)),&lt;/SPAN&gt;&lt;SPAN style="color: maroon;"&gt;[Division-&amp;gt;Depart-&amp;gt;Employee]&lt;/SPAN&gt;&lt;SPAN style="color: black;"&gt;,WorkType )) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2012 15:41:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-Sum/m-p/380451#M491429</guid>
      <dc:creator>bruno_m_santos</dc:creator>
      <dc:date>2012-08-24T15:41:12Z</dc:date>
    </item>
  </channel>
</rss>

