<?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: Min/Max Function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Min-Max-Function/m-p/434815#M1150867</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can try something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If( (Year(Paid_Date) - Year(Claim_Date))&amp;gt;=5, 5, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If((Year(Paid_Date) - Year(Claim_Date))&amp;lt;0, 0, (Year(Paid_Date) - Year(Claim_Date)))) as &lt;STRONG&gt;Lag_years&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Jun 2013 05:43:29 GMT</pubDate>
    <dc:creator>tresB</dc:creator>
    <dc:date>2013-06-04T05:43:29Z</dc:date>
    <item>
      <title>Min/Max Function</title>
      <link>https://community.qlik.com/t5/QlikView/Min-Max-Function/m-p/434814#M1150866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am facing issues with Min/Max function. There are two date fields Claim_Date and Paid_Date. I want to find the difference in years which I am able to do with the following: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Year(Paid_Date) - Year(Claim_Date) as Lag_years&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works in the scrip editor. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To avoid data errors I want to limit it to minimum 0 and maximum 5. In Excel or SQL this would be simply as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Min(5,Max(0,Year(Paid_Date) - Year(Claim_Date)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, neither the minimum or maximum function are working. I have even tried the following in Expression in the pivot table: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Min(5,Max(0,Lag_Years))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any special way of using Min/Max in Qlikview. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jun 2013 04:22:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Min-Max-Function/m-p/434814#M1150866</guid>
      <dc:creator />
      <dc:date>2013-06-04T04:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: Min/Max Function</title>
      <link>https://community.qlik.com/t5/QlikView/Min-Max-Function/m-p/434815#M1150867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can try something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If( (Year(Paid_Date) - Year(Claim_Date))&amp;gt;=5, 5, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If((Year(Paid_Date) - Year(Claim_Date))&amp;lt;0, 0, (Year(Paid_Date) - Year(Claim_Date)))) as &lt;STRONG&gt;Lag_years&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jun 2013 05:43:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Min-Max-Function/m-p/434815#M1150867</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2013-06-04T05:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: Min/Max Function</title>
      <link>https://community.qlik.com/t5/QlikView/Min-Max-Function/m-p/434816#M1150868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use the rangemax and rangemin functions here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;rangemin(5,rangemax(0,Year(Paid_Date) - Year(Claim_Date))) as Lag_years&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jun 2013 10:40:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Min-Max-Function/m-p/434816#M1150868</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-06-04T10:40:21Z</dc:date>
    </item>
  </channel>
</rss>

