<?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: How to sum values based on selections at different levels in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-sum-values-based-on-selections-at-different-levels/m-p/119711#M760440</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the expected output for the data provided?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Aug 2018 13:28:40 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2018-08-08T13:28:40Z</dc:date>
    <item>
      <title>How to sum values based on selections at different levels</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sum-values-based-on-selections-at-different-levels/m-p/119710#M760439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Below is my raw table and final output table with bands (range). However, my expressions (Total Account &amp;amp; Amount) aren't working.&lt;/P&gt;&lt;P&gt;Attached is a sample qvw. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on what selection (State, County, City or Zip) is made, the Amount should fall in the corresponding range. &lt;BR /&gt;Selection can be one state or multiple states and so forth. I tried using set analysis but didn't quite get the correct result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas how this can be handled? Thanks!&lt;/P&gt;&lt;P&gt;&lt;IMG alt="LP Test1.JPG" class="jive-image image-1" src="/legacyfs/online/210256_LP Test1.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sum-values-based-on-selections-at-different-levels/m-p/119710#M760439</guid>
      <dc:creator>newqlik2017</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum values based on selections at different levels</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sum-values-based-on-selections-at-different-levels/m-p/119711#M760440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the expected output for the data provided?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2018 13:28:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sum-values-based-on-selections-at-different-levels/m-p/119711#M760440</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-08-08T13:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum values based on selections at different levels</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sum-values-based-on-selections-at-different-levels/m-p/119712#M760441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny, please find the attached excel file for the expected output.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2018 14:33:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sum-values-based-on-selections-at-different-levels/m-p/119712#M760441</guid>
      <dc:creator>newqlik2017</dc:creator>
      <dc:date>2018-08-08T14:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum values based on selections at different levels</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sum-values-based-on-selections-at-different-levels/m-p/119713#M760443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This expression almost works... see if you have missed some data rows and it works for your original app&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum({&amp;lt;ZIP = {"=If(GetSelectedCount(ZIP) &amp;gt; 0, Len(Trim(ZIP)) &amp;gt; 0, Len(Trim(ZIP)) = 0)"}, &lt;/STRONG&gt;&lt;STRONG style="font-size: 10pt;"&gt;COUNTY = {"=If(GetSelectedCount(COUNTY) &amp;gt; 0, Len(Trim(COUNTY)) &amp;gt; 0, Len(Trim(COUNTY)) = 0)"}, &lt;/STRONG&gt;&lt;STRONG style="font-size: 10pt;"&gt;CITY = {"=If(GetSelectedCount(CITY) &amp;gt; 0, Len(Trim(CITY)) &amp;gt; 0, Len(Trim(CITY)) = 0)"}&amp;gt;}AMOUNT) + Sum({1} 0)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Count(DISTINCT {&amp;lt;ZIP = {"=If(GetSelectedCount(ZIP) &amp;gt; 0, Len(Trim(ZIP)) &amp;gt; 0, Len(Trim(ZIP)) = 0)"}, &lt;/STRONG&gt;&lt;STRONG style="font-size: 10pt;"&gt;COUNTY = {"=If(GetSelectedCount(COUNTY) &amp;gt; 0, Len(Trim(COUNTY)) &amp;gt; 0, Len(Trim(COUNTY)) = 0)"}, &lt;/STRONG&gt;&lt;STRONG style="font-size: 10pt;"&gt;CITY = {"=If(GetSelectedCount(CITY) &amp;gt; 0, Len(Trim(CITY)) &amp;gt; 0, Len(Trim(CITY)) = 0)"}&amp;gt;}ACCOUNT_NUM) + Sum({1} 0)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2018 15:00:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sum-values-based-on-selections-at-different-levels/m-p/119713#M760443</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-08-08T15:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum values based on selections at different levels</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sum-values-based-on-selections-at-different-levels/m-p/119714#M760446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="Test_S1.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/210430_Test_S1.JPG" style="width: 620px; height: 203px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Test_S2.JPG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/210434_Test_S2.JPG" style="width: 620px; height: 208px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Sunny, yes you are right - I think I missed some data rows. However, during my testing I found this expression didn't work in the above examples. Screen shots attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) First image, when NJ state and Lehigh2 city is selected, the final table displays 0. Correct total account is 1 and amount is 21617&lt;BR /&gt;2) Second image, when NJ state and Lehigh1+Lehigh2 city is selected, the final table still displays 0. Correct total account is 2 and amount is 21617 + 1125 = 22742&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas, please? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2018 16:03:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sum-values-based-on-selections-at-different-levels/m-p/119714#M760446</guid>
      <dc:creator>newqlik2017</dc:creator>
      <dc:date>2018-08-09T16:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum values based on selections at different levels</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sum-values-based-on-selections-at-different-levels/m-p/119715#M760449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I meant state = PA (not NJ) in my prior response. Correction.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2018 16:04:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sum-values-based-on-selections-at-different-levels/m-p/119715#M760449</guid>
      <dc:creator>newqlik2017</dc:creator>
      <dc:date>2018-08-09T16:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum values based on selections at different levels</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sum-values-based-on-selections-at-different-levels/m-p/119716#M760450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum({&amp;lt;ZIP = {"=If(GetSelectedCount(ZIP) &amp;gt; 0, Len(Trim(ZIP)) &amp;gt; 0, Len(Trim(ZIP)) = 0)"},&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; COUNTY = {"=If(GetSelectedCount(COUNTY) &amp;gt; 0 or GetSelectedCount(CITY) &amp;gt; 0 or GetSelectedCount(ZIP) &amp;gt; 0, Len(Trim(COUNTY)) &amp;gt; 0, Len(Trim(COUNTY)) = 0)"},&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; CITY = {"=If(GetSelectedCount(CITY) &amp;gt; 0 or GetSelectedCount(ZIP) &amp;gt; 0, Len(Trim(CITY)) &amp;gt; 0, Len(Trim(CITY)) = 0)"}&amp;gt;}AMOUNT) + Sum({1} 0)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2018 16:11:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sum-values-based-on-selections-at-different-levels/m-p/119716#M760450</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-08-09T16:11:01Z</dc:date>
    </item>
  </channel>
</rss>

