<?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 Set Analysis using an If in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-using-an-If/m-p/1216182#M461740</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to use the following set analysis expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum(If({$&amp;lt;Division={'B'},FY={$(vFY)}&amp;gt;}&lt;A&gt;+&lt;B&gt;,&lt;C&gt;+&lt;D&gt;))&lt;/D&gt;&lt;/C&gt;&lt;/B&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I am trying to do is get the Sum of &lt;A&gt; + &lt;B&gt; when Division = 'B' and FY = vFY and if it does not, then get the Sum of &lt;C&gt; + &lt;D&gt;.&amp;nbsp; The current expression is not valid.&amp;nbsp; How can I write this?&lt;/D&gt;&lt;/C&gt;&lt;/B&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Dec 2016 22:11:19 GMT</pubDate>
    <dc:creator>cliff_clayman</dc:creator>
    <dc:date>2016-12-06T22:11:19Z</dc:date>
    <item>
      <title>Set Analysis using an If</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-using-an-If/m-p/1216182#M461740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to use the following set analysis expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum(If({$&amp;lt;Division={'B'},FY={$(vFY)}&amp;gt;}&lt;A&gt;+&lt;B&gt;,&lt;C&gt;+&lt;D&gt;))&lt;/D&gt;&lt;/C&gt;&lt;/B&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I am trying to do is get the Sum of &lt;A&gt; + &lt;B&gt; when Division = 'B' and FY = vFY and if it does not, then get the Sum of &lt;C&gt; + &lt;D&gt;.&amp;nbsp; The current expression is not valid.&amp;nbsp; How can I write this?&lt;/D&gt;&lt;/C&gt;&lt;/B&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2016 22:11:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-using-an-If/m-p/1216182#M461740</guid>
      <dc:creator>cliff_clayman</dc:creator>
      <dc:date>2016-12-06T22:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis using an If</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-using-an-If/m-p/1216183#M461741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be 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: 13px;"&gt;&lt;STRONG&gt;Sum(If(Division='B' and FY=$(vFY), &lt;A&gt; + &lt;B&gt;, &lt;C&gt;+&lt;D&gt;))&lt;/D&gt;&lt;/C&gt;&lt;/B&gt;&lt;/A&gt;&lt;/STRONG&gt;&lt;A&gt;&lt;B&gt;&lt;/B&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2016 22:17:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-using-an-If/m-p/1216183#M461741</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-06T22:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis using an If</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-using-an-If/m-p/1216184#M461742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or 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: 13px;"&gt;&lt;STRONG&gt;RangeSum(Sum({$&amp;lt;Division*= {'B'}, FY *= {$(vFY)}&amp;gt;} &lt;A&gt;+&lt;B&gt;), &lt;/B&gt;&lt;/A&gt;&lt;/STRONG&gt;&lt;A&gt;&lt;B&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;Sum({$&amp;lt;Division -= {'B'}, FY -= {$(vFY)}&amp;gt;} &lt;C&gt;+&lt;D&gt;))&lt;/D&gt;&lt;/C&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2016 22:19:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-using-an-If/m-p/1216184#M461742</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-06T22:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis using an If</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-using-an-If/m-p/1216185#M461743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can I not use Set Analysis for this type of expression?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2016 22:19:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-using-an-If/m-p/1216185#M461743</guid>
      <dc:creator>cliff_clayman</dc:creator>
      <dc:date>2016-12-06T22:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis using an If</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-using-an-If/m-p/1216186#M461744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might, but not every thing can be solved using if statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2016 22:22:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-using-an-If/m-p/1216186#M461744</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-06T22:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis using an If</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-using-an-If/m-p/1216187#M461745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The second sum looks incorrect to me. Say vFY = 2016, and we have this data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;FY&amp;nbsp; Division&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;2015 A&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;2016 A&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;2015 B&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;2016 B&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first sum will correctly get row 4. The second sum is intended to get rows 1, 2, and 3, but I think it will only get row 1. And I don't think we need rangesum() because sum() should never return null, I believe.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this would do the trick.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;sum({&amp;lt;Division={'B'},FY={'$(vFY)'}&amp;gt;} A+B)+sum({$-&amp;lt;Division={'B'},FY={'$(vFY)'}&amp;gt;} C+D)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2016 00:17:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-using-an-If/m-p/1216187#M461745</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2016-12-07T00:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis using an If</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-using-an-If/m-p/1216188#M461746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes sir, I forgot my Venn Diagram lessons here &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;. This should work I believe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;RangeSum(Sum({$&amp;lt;Division*= {'B'}, FY *= {$(vFY)}&amp;gt;} &lt;A&gt;+&lt;B&gt;), &lt;/B&gt;&lt;/A&gt;&lt;/STRONG&gt;&lt;A&gt;&lt;B&gt;&lt;/B&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;Sum({$&amp;lt;Division -= {'B'}&lt;SPAN style="color: #ff0000;"&gt;&amp;gt;+&amp;lt;&lt;/SPAN&gt;FY -= {$(vFY)}&amp;gt;} &lt;C&gt;+&lt;D&gt;))&lt;/D&gt;&lt;/C&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Updated from * to + based on John's response &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2016 00:58:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-using-an-If/m-p/1216188#M461746</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-07T00:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis using an If</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-using-an-If/m-p/1216189#M461747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Almost, but same problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;lt;Division-={'B'}&amp;gt; = {1,2}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;lt;FY-={$(vFY)}&amp;gt; = {1,3}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;{1,2}*{1,3} = {1}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;{1,2}+{1,3} = {1,2,3}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So we need to use union + instead of intersection *, but otherwise, yes, you can fix your expression as you showed. I think mine's a little more clear, as it has the if/else form of "some set" and "everything except that set", but both look like they'd work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2016 02:27:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-using-an-If/m-p/1216189#M461747</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2016-12-07T02:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis using an If</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-using-an-If/m-p/1216190#M461748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hahahaha yes.... how can I be so stupid... Well at time I can be. My intentions were right, my expressions were not &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2016 02:29:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-using-an-If/m-p/1216190#M461748</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-07T02:29:11Z</dc:date>
    </item>
  </channel>
</rss>

