<?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 Sum if Distinct in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sum-if-Distinct/m-p/328018#M1195088</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I guess I just don't understand what you want.&amp;nbsp; Perhaps post an example file with an inline load for the data and a chart showing the results you want.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 May 2011 17:54:59 GMT</pubDate>
    <dc:creator>johnw</dc:creator>
    <dc:date>2011-05-26T17:54:59Z</dc:date>
    <item>
      <title>Sum if Distinct</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-Distinct/m-p/328014#M1195084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to sum the transaction amount if the trans type field is ACH Return and it has a distinct loan number.&amp;nbsp; My expression is not correct and I am not sure the best way to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!!&lt;/P&gt;&lt;P&gt;Kristy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$*&amp;lt;[TranType]="*ACH Return*"}DISTINCT(LoanNbr)&amp;gt;})[Tran Amt] &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2011 16:19:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-Distinct/m-p/328014#M1195084</guid>
      <dc:creator />
      <dc:date>2011-05-25T16:19:04Z</dc:date>
    </item>
    <item>
      <title>Sum if Distinct</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-Distinct/m-p/328015#M1195085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I am getting closer.&amp;nbsp; I now have the expression below.&amp;nbsp; Something is still not right though.&amp;nbsp; I only want to total the Tran Amounts for all of the ACH Return Tran Types that have distinct loan numbers.&amp;nbsp; Can anyone help?&lt;IMG alt="expression for question.bmp" class="jive-image-thumbnail jive-image" height="199" onclick="" src="https://community.qlik.com/legacyfs/online/4732_expression+for+question.bmp" width="641" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2011 20:31:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-Distinct/m-p/328015#M1195085</guid>
      <dc:creator />
      <dc:date>2011-05-25T20:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if Distinct</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-Distinct/m-p/328016#M1195086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure I understood.&amp;nbsp; Maybe this?&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;[Tran Type]*={"*ACH Return*"}&amp;gt;} aggr(if(count(distinct LoanNbr)=1,[Tran Amt]),[Tran Type]))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2011 22:45:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-Distinct/m-p/328016#M1195086</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-05-25T22:45:17Z</dc:date>
    </item>
    <item>
      <title>Sum if Distinct</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-Distinct/m-p/328017#M1195087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried that expression but got $0's.&amp;nbsp; My spreadsheet has a ton of different Trans Types.&amp;nbsp; I want to sum the ACH Return transaction amounts, but there are multiple loan numbers.&amp;nbsp; I only want to sum the tran amounts for the ACH returns with distinct loan numbers. (However, I do want to keep multiple loan numbers in for the other types).&amp;nbsp; Any suggestions?&amp;nbsp; I have searched for other issues and you have unknowingly helped with those - so i know if anyone can help, you can!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2011 12:48:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-Distinct/m-p/328017#M1195087</guid>
      <dc:creator />
      <dc:date>2011-05-26T12:48:25Z</dc:date>
    </item>
    <item>
      <title>Sum if Distinct</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-Distinct/m-p/328018#M1195088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I guess I just don't understand what you want.&amp;nbsp; Perhaps post an example file with an inline load for the data and a chart showing the results you want.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2011 17:54:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-Distinct/m-p/328018#M1195088</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-05-26T17:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if Distinct</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-Distinct/m-p/328019#M1195089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Attached is my guess of what you want.&amp;nbsp; It has two solutions, one using a calculated dimension, one using an expression.&amp;nbsp; In it, Tran Type "ACH Return A" isn't in the chart because it's an ACH return with more than one loan number associated with it. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2011 19:13:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-Distinct/m-p/328019#M1195089</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-05-26T19:13:07Z</dc:date>
    </item>
    <item>
      <title>Sum if Distinct</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-Distinct/m-p/328020#M1195090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; The 1st expression gave me $7m figure (i am looking for a 200k one).&amp;nbsp; The 2nd expression came up null.&amp;nbsp; I have attached a spreadsheet with the full data and the number I want to get to.&amp;nbsp; I have the tran type filtered, so its only ACH Returns already.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2011 21:59:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-Distinct/m-p/328020#M1195090</guid>
      <dc:creator />
      <dc:date>2011-05-26T21:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if Distinct</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-Distinct/m-p/328021#M1195091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The 1st expression gave me $7m figure (i am looking for a 200k one).&amp;nbsp; The 2nd expression came up null.&amp;nbsp; I have attached a spreadsheet with the full data and the number I want to get to.&amp;nbsp; I have the tran type filtered, so its only ACH Returns already.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2011 22:00:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-Distinct/m-p/328021#M1195091</guid>
      <dc:creator />
      <dc:date>2011-05-26T22:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: Sum if Distinct</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-if-Distinct/m-p/328022#M1195092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, so it looks like you want the Tran Amt from the FIRST time you encounter a given LoanNbr in your data set in the sequence you loaded it.&amp;nbsp; In the attached, I load an ID field from recno() during the initial load.&amp;nbsp; Then I left join to it with an order by, allowing me to set a "First?" flag.&amp;nbsp; Then I use set analysis to only look at the first row for a given loan number.&amp;nbsp; &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;LOAD *&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,recno() as ID&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;INLINE [&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LoanNbr Tran Type Tran Amt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;1037553 ACH Return&amp;nbsp; 176.47 &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;] (delimiter is ' ');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LEFT JOIN (Data)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD ID&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,if(LoanNbr&amp;lt;&amp;gt;previous(LoanNbr),1) as First?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RESIDENT Data&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;ORDER BY LoanNbr, ID&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;sum({&amp;lt;First?={'1'}&amp;gt;} "Tran Amt")&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2011 22:28:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-if-Distinct/m-p/328022#M1195092</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-05-26T22:28:13Z</dc:date>
    </item>
  </channel>
</rss>

