<?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: SUM TOTAL with if condition in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/SUM-TOTAL-with-if-condition/m-p/1788092#M1210260</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just to update that I am able to achieve this using total as below -&lt;/P&gt;&lt;P&gt;sum(if([Event Date] &amp;lt;= EOM_Date,[Sale Amt]))&lt;BR /&gt;/&lt;BR /&gt;sum(total&amp;lt;EOM_Date&amp;gt; if([Event Date] &amp;lt;= EOM_Date,[Sale Amt]))&lt;/P&gt;&lt;P&gt;I was incorrectly using &amp;lt;Segment&amp;gt; in total which was giving skewed figures but the above works perfectly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sumeer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Mar 2021 21:19:01 GMT</pubDate>
    <dc:creator>SR2</dc:creator>
    <dc:date>2021-03-03T21:19:01Z</dc:date>
    <item>
      <title>SUM TOTAL with if condition</title>
      <link>https://community.qlik.com/t5/QlikView/SUM-TOTAL-with-if-condition/m-p/1787843#M1210241</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;I want to create 100% stacked bar chart and using TOTAL keyword in expression.&lt;/P&gt;&lt;P&gt;Dimensions -&lt;/P&gt;&lt;P&gt;1) End of month (last 5 months) - This is reporting date i.e. [EOM_Date]&lt;/P&gt;&lt;P&gt;2) Break up of Sale across different Segments i.e. [Segment]&lt;/P&gt;&lt;P&gt;Measure -&lt;/P&gt;&lt;P&gt;sum(if ([EventDate] &amp;lt;= EOM_Date,[Sale Amt ]))&lt;/P&gt;&lt;P&gt;How to TOTAL keyword in above expression to get break up of Segment -&amp;nbsp;&lt;/P&gt;&lt;P&gt;sum(if ([EventDate] &amp;lt;= EOM_Date, total &amp;lt;[Segment]&amp;gt;[Sale Amt ])) gives error as expected )&lt;/P&gt;&lt;P&gt;Appreciate your&amp;nbsp; help!&lt;/P&gt;&lt;P&gt;PS - I can not remove if condition in the sum and need to know how to use sum, if and total together to get stacked bar chart.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sumeer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2021 10:13:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SUM-TOTAL-with-if-condition/m-p/1787843#M1210241</guid>
      <dc:creator>SR2</dc:creator>
      <dc:date>2021-03-03T10:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: SUM TOTAL with if condition</title>
      <link>https://community.qlik.com/t5/QlikView/SUM-TOTAL-with-if-condition/m-p/1787849#M1210242</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;May be try like below&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sum(total &amp;lt;[Segment]&amp;gt; if ([EventDate] &amp;lt;= EOM_Date, [Sale Amt ])&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2021 10:17:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SUM-TOTAL-with-if-condition/m-p/1787849#M1210242</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2021-03-03T10:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: SUM TOTAL with if condition</title>
      <link>https://community.qlik.com/t5/QlikView/SUM-TOTAL-with-if-condition/m-p/1787892#M1210243</link>
      <description>&lt;P&gt;Hi MayilVahanan,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the quick reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry, I had some network issues so it took longer for me to check and respond here.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The expression is correct syntactically but it is not creating bucket within the given month rather than across all months. Meaning, instead of giving total sale amt for say a month it is calculating total across all months. This is because the dimension Segment is spread across all months.&lt;/P&gt;&lt;P&gt;It seems the total keyword is not useful to create 100% stacked bar chart in this case as the dimension is spread across all months. I am able to achieve it by creating each measure separately though.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sumeer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2021 12:11:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SUM-TOTAL-with-if-condition/m-p/1787892#M1210243</guid>
      <dc:creator>SR2</dc:creator>
      <dc:date>2021-03-03T12:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: SUM TOTAL with if condition</title>
      <link>https://community.qlik.com/t5/QlikView/SUM-TOTAL-with-if-condition/m-p/1788092#M1210260</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just to update that I am able to achieve this using total as below -&lt;/P&gt;&lt;P&gt;sum(if([Event Date] &amp;lt;= EOM_Date,[Sale Amt]))&lt;BR /&gt;/&lt;BR /&gt;sum(total&amp;lt;EOM_Date&amp;gt; if([Event Date] &amp;lt;= EOM_Date,[Sale Amt]))&lt;/P&gt;&lt;P&gt;I was incorrectly using &amp;lt;Segment&amp;gt; in total which was giving skewed figures but the above works perfectly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sumeer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2021 21:19:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SUM-TOTAL-with-if-condition/m-p/1788092#M1210260</guid>
      <dc:creator>SR2</dc:creator>
      <dc:date>2021-03-03T21:19:01Z</dc:date>
    </item>
  </channel>
</rss>

