<?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: Set Analysis/Aggr help? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Aggr-help/m-p/670463#M243637</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I never tried that, but I did figure out the solution. I needed to order the Aggr differently. If I put the date field first, before event and year, it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding the max function, I can actually use that for something else - it had never occurred to me before. But it looks like it can't use a dimension as the rank parameter. So if I have a dimension that has values associated with it, I can't refer to the values in my max statement. They all just return the highest value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, I have the following table, let's say for test scores:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Place&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rank&lt;/P&gt;&lt;P&gt;1st&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;2nd&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;3rd&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I put Place as my dimension, then I do Max(TestScore, Rank) as the expression, it will always return the highest test score, for each place. Am I doing something wrong there?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Oct 2014 13:33:46 GMT</pubDate>
    <dc:creator>danielact</dc:creator>
    <dc:date>2014-10-21T13:33:46Z</dc:date>
    <item>
      <title>Set Analysis/Aggr help?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Aggr-help/m-p/670461#M243635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a chart which uses the following expression:&lt;/P&gt;&lt;P&gt;max(if(aggr(NODISTINCT rank(max(aggr(NODISTINCT sum(Losses),Event,Year)),4,1),Year)=20,aggr(sum(Losses),Event,Year)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, I want to get the maximum loss event for each year, then take the 20th ranked loss. This data is as-of a certain date, which is always selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A user asked to see it over time, and how the number has changed. So I set up a chart with the different as-of dates as a dimension, and am trying to adjust the expression accordingly, but I can't get it to work. Here's what I'm using now:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;max({$&amp;lt;AsOfDate=&amp;gt;}if(aggr(NODISTINCT rank(max(aggr(NODISTINCT sum({$&amp;lt;AsOfDate=&amp;gt;}Losses),Event,Year,AsOfDate)),4,1),Year,AsOfDate)=20,aggr(sum({$&amp;lt;AsOfDate=&amp;gt;}Losses),Event,Year,AsOfDate)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea why this isn't working?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 12:30:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Aggr-help/m-p/670461#M243635</guid>
      <dc:creator>danielact</dc:creator>
      <dc:date>2014-10-21T12:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis/Aggr help?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Aggr-help/m-p/670462#M243636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What about using the "rank" parameter of the max function, something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;max(aggr(NODISTINCT sum(Losses),Event,Year)),&lt;STRONG&gt;20&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cesar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 13:08:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Aggr-help/m-p/670462#M243636</guid>
      <dc:creator>cesaraccardi</dc:creator>
      <dc:date>2014-10-21T13:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis/Aggr help?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Aggr-help/m-p/670463#M243637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I never tried that, but I did figure out the solution. I needed to order the Aggr differently. If I put the date field first, before event and year, it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding the max function, I can actually use that for something else - it had never occurred to me before. But it looks like it can't use a dimension as the rank parameter. So if I have a dimension that has values associated with it, I can't refer to the values in my max statement. They all just return the highest value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, I have the following table, let's say for test scores:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Place&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rank&lt;/P&gt;&lt;P&gt;1st&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;2nd&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;3rd&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I put Place as my dimension, then I do Max(TestScore, Rank) as the expression, it will always return the highest test score, for each place. Am I doing something wrong there?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 13:33:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Aggr-help/m-p/670463#M243637</guid>
      <dc:creator>danielact</dc:creator>
      <dc:date>2014-10-21T13:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis/Aggr help?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Aggr-help/m-p/670464#M243638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think it doesn't work that way because a field like Rank can have multiple values and the Max function is expecting a single value. So you would have to aggregate them somehow, possibly using a variable that stores the desired rank if that makes sense. Please can you give more details about your requirement, do you want to have a different number for each line on your table?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 13:48:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Aggr-help/m-p/670464#M243638</guid>
      <dc:creator>cesaraccardi</dc:creator>
      <dc:date>2014-10-21T13:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis/Aggr help?</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Aggr-help/m-p/670465#M243639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I'd want the highest score on the first line, the 2nd highest on the second line, etc. It should still only be returning one value, because the Rank field (bad name, I know, because there's an expression with that name) only has one value associated with the dimension.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 13:51:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Aggr-help/m-p/670465#M243639</guid>
      <dc:creator>danielact</dc:creator>
      <dc:date>2014-10-21T13:51:18Z</dc:date>
    </item>
  </channel>
</rss>

