<?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 RANGEMAX issue - QlikView in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/RANGEMAX-issue-QlikView/m-p/118076#M603418</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having an issue with the RANGEMAX function in my load script. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table with 2 columns - project IDs and a field/column of 'milestones' per project (so multiple milestone dates). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to get the 'latest' (so closest to today) date per project - that is what i tried to achieve with line ****-1. However, that is not working as the Latest_Gateway_Date field output returns all the dates, not the latest date as I expect. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then want to match that latest date back to itself to reference what value is in 'Gateway_Type' - this is line ****-2. E.g. if the date matches the date for Gateway_4 (which is a Gateway_Type value) for example, then it will return me 'Gateway_4'. I think this is falling over because of line ****-1, however.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code is below - any help would be greatly appreciated &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Taz&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD DISTINCT Project_ID,&lt;/P&gt;&lt;P&gt;RANGEMAX(Gateway_Date,Project_ID) AS Latest_Gateway_Date ****- 1 &lt;/P&gt;&lt;P&gt;IF(Latest_Gateway_Date=Gateway_Date,Gateway_Type) AS Latest_Gateway_Type ****- 2&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[$(vG.QVDPath)$(vL.GatewaysPath)] (qvd)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Aug 2018 09:12:54 GMT</pubDate>
    <dc:creator>tjagdev5</dc:creator>
    <dc:date>2018-08-24T09:12:54Z</dc:date>
    <item>
      <title>RANGEMAX issue - QlikView</title>
      <link>https://community.qlik.com/t5/QlikView/RANGEMAX-issue-QlikView/m-p/118076#M603418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having an issue with the RANGEMAX function in my load script. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table with 2 columns - project IDs and a field/column of 'milestones' per project (so multiple milestone dates). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to get the 'latest' (so closest to today) date per project - that is what i tried to achieve with line ****-1. However, that is not working as the Latest_Gateway_Date field output returns all the dates, not the latest date as I expect. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then want to match that latest date back to itself to reference what value is in 'Gateway_Type' - this is line ****-2. E.g. if the date matches the date for Gateway_4 (which is a Gateway_Type value) for example, then it will return me 'Gateway_4'. I think this is falling over because of line ****-1, however.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code is below - any help would be greatly appreciated &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Taz&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD DISTINCT Project_ID,&lt;/P&gt;&lt;P&gt;RANGEMAX(Gateway_Date,Project_ID) AS Latest_Gateway_Date ****- 1 &lt;/P&gt;&lt;P&gt;IF(Latest_Gateway_Date=Gateway_Date,Gateway_Type) AS Latest_Gateway_Type ****- 2&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[$(vG.QVDPath)$(vL.GatewaysPath)] (qvd)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2018 09:12:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/RANGEMAX-issue-QlikView/m-p/118076#M603418</guid>
      <dc:creator>tjagdev5</dc:creator>
      <dc:date>2018-08-24T09:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: RANGEMAX issue - QlikView</title>
      <link>https://community.qlik.com/t5/QlikView/RANGEMAX-issue-QlikView/m-p/118077#M603419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot refer the Alias name in the same load for IF condition. May be try preceding load like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="statement" data-mc-conditions="Primary.NotToTranslate" style="font-weight: bold; color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif; font-size: 14px;"&gt;From Reference Help: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="statement" data-mc-conditions="Primary.NotToTranslate" style="font-weight: bold; color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif; font-size: 14px;"&gt;RangeMax()&lt;/SPAN&gt;&lt;SPAN style="color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif; font-size: 14px;"&gt; returns the highest numeric value found within the expression or field.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif; font-size: 14px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif; font-size: 14px;"&gt;So you are trying to pick the max date comparing with Project_ID which is not date. Is this right? May be you want to pick Max date from two dates like highlighted below: &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;LOAD *, &lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;IF(Latest_Gateway_Date=Gateway_Date,Gateway_Type) AS Latest_Gateway_Type ****- 2;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD DISTINCT Project_ID,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;RANGEMAX(&lt;STRONG&gt;Gateway_Date&lt;/STRONG&gt;, &lt;STRONG&gt;AnotherDateField&lt;/STRONG&gt;) AS Latest_Gateway_Date ****- 1&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[$(vG.QVDPath)$(vL.GatewaysPath)] (qvd):&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;OR&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Get the Max dates like below&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;LOAD *,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;IF(Latest_Gateway_Date=Gateway_Date, Gateway_Type) AS [Latest_Gateway_Type];&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;LOAD DISTINCT Project_ID,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MAX(Gateway_Date) AS [Latest_Gateway_Date]&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;[$(vG.QVDPath)$(vL.GatewaysPath)] (qvd)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Group By Project_ID:&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2018 16:38:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/RANGEMAX-issue-QlikView/m-p/118077#M603419</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2018-08-24T16:38:04Z</dc:date>
    </item>
  </channel>
</rss>

