<?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: [ASK] IF-ELSE Condition inside Aggr in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/ASK-IF-ELSE-Condition-inside-Aggr/m-p/1436403#M431474</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to use Sum(Aggr()) to get this right&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #ff0000;"&gt;Sum(Aggr(&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if([Sum Qty YTD Cur Month]=[Sum Qty YTD Prev Month],[Sum Amount YTD Current Month],0)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;+&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if([Sum Qty YTD Cur Month]=[Sum Qty YTD Prev Month],0,[Sum Amount YTD Current Month])&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: inherit; font-style: inherit; font-weight: inherit; font-size: 13.3333px;"&gt;&lt;STRONG style="color: #ff0000;"&gt;,MATERIAL, LEVEL2))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Dec 2017 13:05:24 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2017-12-06T13:05:24Z</dc:date>
    <item>
      <title>[ASK] IF-ELSE Condition inside Aggr</title>
      <link>https://community.qlik.com/t5/QlikView/ASK-IF-ELSE-Condition-inside-Aggr/m-p/1436402#M431473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear QlikView Master,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a client that required sum value based on year-to-date quantity condition.&lt;/P&gt;&lt;P&gt;So if Quantity YTD Current Month is not the same as YTD Previous Month, then sum YTD Current Month Value , else sum YTD Previous Month Value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently in my straight table chart i use if-else condition like below.&lt;/P&gt;&lt;P&gt;The formula condition is similar to :&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Header 1&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;P style="font-size: 13.3333px;"&gt;if([Sum Qty YTD Cur Month]=[Sum Qty YTD Prev Month],[Sum Amount YTD Current Month],0)&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;+&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;if([Sum Qty YTD Cur Month]=[Sum Qty YTD Prev Month],0,[Sum Amount YTD Current Month])&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i use that formula, it shows correct result if i use 'TOtal Mode : Sum of Rows'.&lt;/P&gt;&lt;P&gt;But if i use pivot table, it doesn't show correct result, only [Sum Amount YTD Current Month]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on my above description, is there any posible way to achieve that?&lt;/P&gt;&lt;P&gt;Below is my excel simulation to give more clearer picture.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/185911_Capture.PNG" style="height: 478px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thank you,&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 09:45:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ASK-IF-ELSE-Condition-inside-Aggr/m-p/1436402#M431473</guid>
      <dc:creator>rendiyan</dc:creator>
      <dc:date>2017-12-06T09:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: [ASK] IF-ELSE Condition inside Aggr</title>
      <link>https://community.qlik.com/t5/QlikView/ASK-IF-ELSE-Condition-inside-Aggr/m-p/1436403#M431474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to use Sum(Aggr()) to get this right&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #ff0000;"&gt;Sum(Aggr(&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if([Sum Qty YTD Cur Month]=[Sum Qty YTD Prev Month],[Sum Amount YTD Current Month],0)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;+&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if([Sum Qty YTD Cur Month]=[Sum Qty YTD Prev Month],0,[Sum Amount YTD Current Month])&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #3d3d3d; font-family: inherit; font-style: inherit; font-weight: inherit; font-size: 13.3333px;"&gt;&lt;STRONG style="color: #ff0000;"&gt;,MATERIAL, LEVEL2))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 13:05:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ASK-IF-ELSE-Condition-inside-Aggr/m-p/1436403#M431474</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-12-06T13:05:24Z</dc:date>
    </item>
  </channel>
</rss>

