<?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: Sum based on maximum value of flag in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sum-based-on-maximum-value-of-flag/m-p/648659#M237455</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ajay, thank you, that works.&lt;/P&gt;&lt;P&gt;However my sub total for each category stopped working...&lt;/P&gt;&lt;P&gt;My actual results looks like this:&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="264"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="66"&gt;Estimate&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="66"&gt;Category&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="68"&gt;Original&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="64"&gt;Latest&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt;a&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;cat1&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;123&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;136&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt; &lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;cat2&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt; &lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;cat3&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt; &lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;Total&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;128&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;151&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt;b&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;cat1&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;52&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;52&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt; &lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;cat2&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt; &lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;Total&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;57&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;57&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;When I implemented FirstSortedValue(), the numbers in "Latest" column are correct, but Total now "-".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Jul 2014 19:22:17 GMT</pubDate>
    <dc:creator>spinchuk</dc:creator>
    <dc:date>2014-07-24T19:22:17Z</dc:date>
    <item>
      <title>Sum based on maximum value of flag</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-based-on-maximum-value-of-flag/m-p/648657#M237453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have data like this:&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="192"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" width="64"&gt;Estimate&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;Version&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;Amount&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: none;"&gt;a&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;123&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: none;"&gt;a&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;136&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: none;"&gt;b&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;52&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need help with formula that will calculate "Latest" column in the PIVOT table like below:&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="198"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="66"&gt;Estimate&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="68"&gt;Original&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="64"&gt;Latest&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt;a&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;123&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;136&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt;b&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;52&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;52&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My current expression for "Original" is &lt;STRONG&gt;Sum({$&amp;lt;Version = {1}&amp;gt; Amount} &lt;/STRONG&gt;work fine.&lt;/P&gt;&lt;P&gt;But my Expression for "Latest" &lt;STRONG&gt;Sum({$&amp;lt;Version = {$(=Max(Version))}&amp;gt;}Amount)&lt;/STRONG&gt; does not work, because the Max(Version) = 2 for both estimates. Since estimate b does not have version 2 - i'm getting blank.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help please?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 18:48:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-based-on-maximum-value-of-flag/m-p/648657#M237453</guid>
      <dc:creator>spinchuk</dc:creator>
      <dc:date>2014-07-24T18:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: Sum based on maximum value of flag</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-based-on-maximum-value-of-flag/m-p/648658#M237454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Attached with answer.Hope it helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 18:57:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-based-on-maximum-value-of-flag/m-p/648658#M237454</guid>
      <dc:creator />
      <dc:date>2014-07-24T18:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: Sum based on maximum value of flag</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-based-on-maximum-value-of-flag/m-p/648659#M237455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ajay, thank you, that works.&lt;/P&gt;&lt;P&gt;However my sub total for each category stopped working...&lt;/P&gt;&lt;P&gt;My actual results looks like this:&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="264"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="66"&gt;Estimate&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="66"&gt;Category&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="68"&gt;Original&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="64"&gt;Latest&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt;a&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;cat1&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;123&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;136&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt; &lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;cat2&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt; &lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;cat3&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt; &lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;Total&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;128&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;151&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt;b&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;cat1&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;52&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;52&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt; &lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;cat2&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt; &lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;Total&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;57&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;57&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;When I implemented FirstSortedValue(), the numbers in "Latest" column are correct, but Total now "-".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 19:22:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-based-on-maximum-value-of-flag/m-p/648659#M237455</guid>
      <dc:creator>spinchuk</dc:creator>
      <dc:date>2014-07-24T19:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Sum based on maximum value of flag</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-based-on-maximum-value-of-flag/m-p/648660#M237456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For subtotals use dimensionality () and kinda play arund with the formyula&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 19:38:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-based-on-maximum-value-of-flag/m-p/648660#M237456</guid>
      <dc:creator />
      <dc:date>2014-07-24T19:38:18Z</dc:date>
    </item>
  </channel>
</rss>

