<?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: if sum syntax in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/if-sum-syntax/m-p/1008220#M973440</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try enclosing the ONLY() function in the RangeSum() function - this way, the possible NULL value will get replaced with a zero, and the expression will be valid:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=if(isnull(only(PeriodBlockChoice)),sum([Day # Envelopes Sent] * _FiscCurrYTDFlag)&amp;nbsp; ,sum([Day # Envelopes Sent] * $(=&lt;STRONG&gt;rangesum&lt;/STRONG&gt;(only(PeriodBlockChoice)))) )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;cheers,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Oleg Troyansky&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.amazon.com/gp/product/1118949552/ref=as_li_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=1118949552&amp;amp;linkCode=as2&amp;amp;tag=natursyner0f-20&amp;amp;linkId=HEF4KYLLE22XIQH2"&gt;QlikView Your Business: An expert guide to Business Discovery with QlikView and Qlik Sense&lt;/A&gt;&lt;IMG alt="" border="0" height="1" src="http://ir-na.amazon-adsystem.com/e/ir?t=natursyner0f-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=1118949552" style="border: none !important; margin: 0px !important;" width="1" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Sep 2015 22:09:23 GMT</pubDate>
    <dc:creator>Oleg_Troyansky</dc:creator>
    <dc:date>2015-09-09T22:09:23Z</dc:date>
    <item>
      <title>if sum syntax</title>
      <link>https://community.qlik.com/t5/QlikView/if-sum-syntax/m-p/1008219#M973439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the proper way to structure this is statement, I'm getting the error below when I do not have a period dimension selected:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="if_image.PNG" class="jive-image image-1" height="38" src="https://community.qlik.com/legacyfs/online/98451_if_image.PNG" style="height: 38.3081px; width: 609px;" width="609" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="if_image2.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/98452_if_image2.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(isnull(only(PeriodBlockChoice)),sum([Day # Envelopes Sent] * _FiscCurrYTDFlag)&amp;nbsp; ,sum([Day # Envelopes Sent] * $(=only(PeriodBlockChoice))) ) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Sep 2015 21:46:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-sum-syntax/m-p/1008219#M973439</guid>
      <dc:creator>gerrycastellino</dc:creator>
      <dc:date>2015-09-09T21:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: if sum syntax</title>
      <link>https://community.qlik.com/t5/QlikView/if-sum-syntax/m-p/1008220#M973440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try enclosing the ONLY() function in the RangeSum() function - this way, the possible NULL value will get replaced with a zero, and the expression will be valid:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=if(isnull(only(PeriodBlockChoice)),sum([Day # Envelopes Sent] * _FiscCurrYTDFlag)&amp;nbsp; ,sum([Day # Envelopes Sent] * $(=&lt;STRONG&gt;rangesum&lt;/STRONG&gt;(only(PeriodBlockChoice)))) )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;cheers,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Oleg Troyansky&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.amazon.com/gp/product/1118949552/ref=as_li_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=1118949552&amp;amp;linkCode=as2&amp;amp;tag=natursyner0f-20&amp;amp;linkId=HEF4KYLLE22XIQH2"&gt;QlikView Your Business: An expert guide to Business Discovery with QlikView and Qlik Sense&lt;/A&gt;&lt;IMG alt="" border="0" height="1" src="http://ir-na.amazon-adsystem.com/e/ir?t=natursyner0f-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=1118949552" style="border: none !important; margin: 0px !important;" width="1" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Sep 2015 22:09:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-sum-syntax/m-p/1008220#M973440</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2015-09-09T22:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: if sum syntax</title>
      <link>https://community.qlik.com/t5/QlikView/if-sum-syntax/m-p/1008221#M973441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;not quite,&amp;nbsp; the rangesum returns '0,1'.&amp;nbsp; I need it to return the value of the my period flag, ie:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_MTDFlag&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Sep 2015 22:37:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-sum-syntax/m-p/1008221#M973441</guid>
      <dc:creator>gerrycastellino</dc:creator>
      <dc:date>2015-09-09T22:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: if sum syntax</title>
      <link>https://community.qlik.com/t5/QlikView/if-sum-syntax/m-p/1008222#M973442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, I understand... So, here is the problem: when you don't have the Period Block Choice selected, the function only returns NULL(), and the whole expression looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;=if(isnull(only(PeriodBlockChoice)),sum([Day # Envelopes Sent] * _FiscCurrYTDFlag)&amp;nbsp; ,sum([Day # Envelopes Sent] * &lt;STRONG&gt;&lt;EM&gt;&amp;lt;null&amp;gt;&lt;/EM&gt;&lt;/STRONG&gt;)) )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-style: inherit; font-weight: inherit;"&gt;which is of course incorrect. What if you replace the second ONLY() with a MaxString() function? This way, the formula will remain &lt;/SPAN&gt;&lt;SPAN style="font-size: 13px;"&gt;syntactically correct, and the logic will be preserved because of the IF condition:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-style: inherit; font-weight: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-style: inherit; font-weight: inherit;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;=if(isnull(only(PeriodBlockChoice)),sum([Day # Envelopes Sent] * _FiscCurrYTDFlag)&amp;nbsp; ,sum([Day # Envelopes Sent] * $(=MaxString(PeriodBlockChoice))) )&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-style: inherit; font-weight: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-style: inherit; font-weight: inherit;"&gt;cheers,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-style: inherit; font-weight: inherit;"&gt;OlegTroyansky&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-style: inherit; font-weight: inherit;"&gt;Check out my new book &lt;A href="http://www.amazon.com/gp/product/1118949552/ref=as_li_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=1118949552&amp;amp;linkCode=as2&amp;amp;tag=natursyner0f-20&amp;amp;linkId=HEF4KYLLE22XIQH2"&gt;QlikView Your Business&lt;/A&gt;!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-style: inherit; font-weight: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Sep 2015 14:32:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-sum-syntax/m-p/1008222#M973442</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2015-09-11T14:32:41Z</dc:date>
    </item>
  </channel>
</rss>

