<?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: Calculated dimension based on multiple conditions (Aggr() vs SetAnalysis) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculated-dimension-based-on-multiple-conditions-Aggr-vs/m-p/726538#M1082300</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there Gysbert and thanks a lot for your answer.&lt;/P&gt;&lt;P&gt;Of Corse&lt;EM&gt; &lt;/EM&gt;I just added the NODISTINCT and it worked like a dream. You've seen maybe that I tried almost everything but the magic of "NODISTINCT". Thanks a lot once again for this perfect answer, I'm very grateful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Jul 2014 17:11:32 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-07-07T17:11:32Z</dc:date>
    <item>
      <title>Calculated dimension based on multiple conditions (Aggr() vs SetAnalysis)</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-dimension-based-on-multiple-conditions-Aggr-vs/m-p/726536#M1082297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Best QlikView Community members,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I’m trying to create a calculated dimension based om multiple conditions (&lt;EM&gt;The equivalent to Sumifs() in Excel&lt;/EM&gt;). Well, I began on my actual dataset using first the Aggr() function in the following expression: &lt;SPAN lang="EN-US" style="color: blue; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;if&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: maroon; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;AccountNr&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;='106K',&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: blue; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;sum&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: maroon; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;Outcome&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;)-&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: blue; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: blue; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;sum&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: blue; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;if&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt; (&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: maroon; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;AccountNr&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;='4941', &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: maroon; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;Outcome&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;,0)), &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: maroon; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;Name&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;, &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: maroon; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;MonthYear&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;), &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: blue; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;sum&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: maroon; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;Outcome&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;)) &lt;/SPAN&gt;&lt;BR /&gt; &lt;IMG __jive_id="61871" alt="Set1.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/61871_Set1.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;where I’m trying to subtract the outcome for the account number 4941 from that for the account number 106K for the corresponding person and date. Obviously it’s not working. And if you’re wondering why I’m using this particular expression is that because it’s working perfectly in a similar but simpler dataset that I created as an experimental example where I’m using the following expression: &lt;SPAN lang="EN-US" style="color: blue; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;if&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: maroon; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;AccountType&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;='A',&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: blue; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;sum&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: maroon; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;Balance&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;)-&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: blue; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: blue; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;sum&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: blue; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;if&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt; (&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: maroon; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;AccountType&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;='SubA', &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: maroon; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;Balance&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;,0)), &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: maroon; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;Name&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;,&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: maroon; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;ID&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;,&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: maroon; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;Date&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;), &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: blue; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;sum&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: maroon; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;Balance&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="color: black; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-fareast-language: SV;"&gt;)) &lt;/SPAN&gt;In this case I’m subtracting the balance for the AccountTypeID (SubA) from that for the AccountTypeID (A) for the corresponding name and date and it’s working effortlessly. What’s puzzling me is that the same expression is working in one case but not in another similar one.&amp;nbsp; I wonder if I got it right experimentally by doing wrong?! And using SetAnalysis in different ways doesn’t seem to help either no matter how much I try to rewrite the syntax with all the strange signs that’s required.&amp;nbsp; Anyway, I’m attaching the 2 examples hoping that someone can help me find what I’m doing wrong before I run out of coffee and patience.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="61872" alt="Set2.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/61872_Set2.jpg" style="width: 620px; height: 530px;" /&gt;&lt;/P&gt;&lt;P&gt;Best regards to you all.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2014 13:39:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-dimension-based-on-multiple-conditions-Aggr-vs/m-p/726536#M1082297</guid>
      <dc:creator />
      <dc:date>2014-07-07T13:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated dimension based on multiple conditions (Aggr() vs SetAnalysis)</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-dimension-based-on-multiple-conditions-Aggr-vs/m-p/726537#M1082299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(AccountNr='106K',sum(Outcome)-sum(aggr(NODISTINCT sum({&amp;lt;AccountNr={'4941'}&amp;gt;} Outcome), Name, MonthYear)), sum(Outcome))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see attached qvw&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2014 14:49:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-dimension-based-on-multiple-conditions-Aggr-vs/m-p/726537#M1082299</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-07-07T14:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated dimension based on multiple conditions (Aggr() vs SetAnalysis)</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-dimension-based-on-multiple-conditions-Aggr-vs/m-p/726538#M1082300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there Gysbert and thanks a lot for your answer.&lt;/P&gt;&lt;P&gt;Of Corse&lt;EM&gt; &lt;/EM&gt;I just added the NODISTINCT and it worked like a dream. You've seen maybe that I tried almost everything but the magic of "NODISTINCT". Thanks a lot once again for this perfect answer, I'm very grateful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2014 17:11:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-dimension-based-on-multiple-conditions-Aggr-vs/m-p/726538#M1082300</guid>
      <dc:creator />
      <dc:date>2014-07-07T17:11:32Z</dc:date>
    </item>
  </channel>
</rss>

