<?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 Only include max/min values in a graph in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Only-include-max-min-values-in-a-graph/m-p/297598#M1199557</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey thanks for the answers.&lt;/P&gt;&lt;P&gt;It looks good but I can't get it to work in my situation.&lt;/P&gt;&lt;P&gt;Another question regarding MAX that might sort things out:&lt;/P&gt;&lt;P&gt;If I want to use a dimension (say EmployeeID) but I only want to include the newest employees (highest EmployeeID), is there a way to use the max function on my dimension to only include the highest or the 3 highest EmployeeID's?&lt;/P&gt;&lt;P&gt;There is a button in the Dimension window called "Add calculated dimension", is that the right place to add my code and what should i write?&lt;/P&gt;&lt;P&gt;The only thing I've figured out so far is that it should be something like "=MAX([EmployeeID])" but that doesn't seem to work....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another example to clarify: If I've got two dimensions, EmployeeID and Year and the expression sum(sales), I get Employee 1 2 3 4 in 2006, Employee 1 2 3 4 in 2007 etc. If I only want to get Employee 1 2 3 4 in 2006 (not in the other years) or vice versa; only employee 1 in all the years, how do I add a Max() function to strip year/employeeID to only contain a part of the original values (in this case only 2006 from the Year table that usually contains 2006-2010, or only "1" from the EmployeeID table that usually contains 1-4)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Jan 2011 10:24:49 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-01-03T10:24:49Z</dc:date>
    <item>
      <title>Only include max/min values in a graph</title>
      <link>https://community.qlik.com/t5/QlikView/Only-include-max-min-values-in-a-graph/m-p/297595#M1199549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want to write an expression so I can find some of the lowest and highest values in a data collection.&lt;/P&gt;&lt;P&gt;Say I got the following data:&lt;/P&gt;&lt;P&gt;2, 2, 3, 5, 6, 6, 7, 7, 8, 9&lt;/P&gt;&lt;P&gt;What do I write to only include the bottom three (2, 2, 3) or top three (7, 8, 9) values in a graph?&lt;/P&gt;&lt;P&gt;I know how to make it by just sorting by value and only showing a maximum of 3 values in a graph, but that doesn't really eliminate the rest of the values, it's just hiding them.&lt;/P&gt;&lt;P&gt;Is there a way to do it using the max() function and calling the max() value and the 2 values next to it?&lt;/P&gt;&lt;P&gt;One place I'd like to use it at is to mark the bottom 3 values red in a pivot table .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also I wonder how do I enable a pivot table to be manually sorted by clicking on the different labels in it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Jan 2011 16:34:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-include-max-min-values-in-a-graph/m-p/297595#M1199549</guid>
      <dc:creator />
      <dc:date>2011-01-02T16:34:34Z</dc:date>
    </item>
    <item>
      <title>Only include max/min values in a graph</title>
      <link>https://community.qlik.com/t5/QlikView/Only-include-max-min-values-in-a-graph/m-p/297596#M1199551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use something like the following expression:&lt;/P&gt;&lt;P&gt;if(rank(max(Field),4,1)&amp;lt;=3,green())&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;if(rank(-max(Field),4,1)&amp;lt;=3,red())&lt;/P&gt;&lt;P&gt;And no, there isn't a way to enable manual sorting in a pivot table, but there might be workaround in some cases since you can sort a pivot table by an expression and an expression can be a variable that you can allow the user to change by using actions or a macro. This would only work for sorting by expressions values.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Jan 2011 18:42:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-include-max-min-values-in-a-graph/m-p/297596#M1199551</guid>
      <dc:creator>pover</dc:creator>
      <dc:date>2011-01-02T18:42:19Z</dc:date>
    </item>
    <item>
      <title>Only include max/min values in a graph</title>
      <link>https://community.qlik.com/t5/QlikView/Only-include-max-min-values-in-a-graph/m-p/297597#M1199554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this one:&lt;/P&gt;&lt;P&gt;if(count(total distinct [YourDimension]) - rank(sum([FieldToBeCalculated]))+1&amp;lt;=3,sum([FieldToBeCalculated]),&lt;BR /&gt; if(rank(sum([FieldToBeCalculated]))&amp;lt;=3,sum([FieldToBeCalculated]),''))&lt;/P&gt;&lt;P&gt;It will calcule the 3 lowest and highest values.&lt;/P&gt;&lt;P&gt;Then you could use the next expression to colour text:&lt;/P&gt;&lt;P&gt;if(count(total distinct [YourDimension]) - rank(sum([FieldToBeCalculated]))+1&amp;lt;=3,lightred(),&lt;BR /&gt; if(rank(sum([FieldToBeCalculated]))&amp;lt;=3,lightblue(),black()))&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Jan 2011 22:21:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-include-max-min-values-in-a-graph/m-p/297597#M1199554</guid>
      <dc:creator />
      <dc:date>2011-01-02T22:21:04Z</dc:date>
    </item>
    <item>
      <title>Only include max/min values in a graph</title>
      <link>https://community.qlik.com/t5/QlikView/Only-include-max-min-values-in-a-graph/m-p/297598#M1199557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey thanks for the answers.&lt;/P&gt;&lt;P&gt;It looks good but I can't get it to work in my situation.&lt;/P&gt;&lt;P&gt;Another question regarding MAX that might sort things out:&lt;/P&gt;&lt;P&gt;If I want to use a dimension (say EmployeeID) but I only want to include the newest employees (highest EmployeeID), is there a way to use the max function on my dimension to only include the highest or the 3 highest EmployeeID's?&lt;/P&gt;&lt;P&gt;There is a button in the Dimension window called "Add calculated dimension", is that the right place to add my code and what should i write?&lt;/P&gt;&lt;P&gt;The only thing I've figured out so far is that it should be something like "=MAX([EmployeeID])" but that doesn't seem to work....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another example to clarify: If I've got two dimensions, EmployeeID and Year and the expression sum(sales), I get Employee 1 2 3 4 in 2006, Employee 1 2 3 4 in 2007 etc. If I only want to get Employee 1 2 3 4 in 2006 (not in the other years) or vice versa; only employee 1 in all the years, how do I add a Max() function to strip year/employeeID to only contain a part of the original values (in this case only 2006 from the Year table that usually contains 2006-2010, or only "1" from the EmployeeID table that usually contains 1-4)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jan 2011 10:24:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-include-max-min-values-in-a-graph/m-p/297598#M1199557</guid>
      <dc:creator />
      <dc:date>2011-01-03T10:24:49Z</dc:date>
    </item>
    <item>
      <title>Only include max/min values in a graph</title>
      <link>https://community.qlik.com/t5/QlikView/Only-include-max-min-values-in-a-graph/m-p/297599#M1199558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The construction of a calculated dimension is somewhat different than the construction of an expression. You could create a variable called vMaxEmployeeID like the following which returns the third largest EmployeeID value.&lt;/P&gt;&lt;P&gt;=max(EmployeeID,3)&lt;/P&gt;&lt;P&gt;And then in the calculated dimension put something like the following.&lt;/P&gt;&lt;P&gt;if(EmployeeID&amp;gt;vMaxEmployeeID,EmployeeID)&lt;/P&gt;&lt;P&gt;You might want to look into bookmarks, too. You can save a bookmark where the selection is an expression like the one below. This way you don't have to battle to fix a QV report.&lt;/P&gt;&lt;P&gt;=EmployeeID&amp;gt;=max(total EmployeeID,3)&lt;/P&gt;&lt;P&gt;Notice that you should add the total keyword in this search and also when you are using max(EmployeeID) in a chart with EmployeeID as a dimension.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 23:29:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Only-include-max-min-values-in-a-graph/m-p/297599#M1199558</guid>
      <dc:creator>pover</dc:creator>
      <dc:date>2011-01-04T23:29:21Z</dc:date>
    </item>
  </channel>
</rss>

