<?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: Mileage at max datetime in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Mileage-at-max-datetime/m-p/1526743#M37860</link>
    <description>&lt;P&gt;Hi Sunny.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wonder if I can pick this up again? I have a very strange scenario. The solution you proposed works 100% in a smaller app. As soon as I use the expression in the new prod app it returns no values for some of the vehicles!! In the test app I include with some sample data it works perfectly. My main test registration is CCCCCCCC. I am using "Num(Aggr(FirstSortedValue([End OdoMeter], -[Departure DateTime]), [Registration Number]),'# ##0')" in the attached sample as well as in the main app. This screenshot is from the prod app and it is exactly the same fields names as per the attached example, but fails in prod. BTW, The example data for CCCCCCCC is the same as per this screenshot.&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="prod_example_1.JPG" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/3116iF421C1EF1DDB7899/image-size/medium?v=v2&amp;amp;px=400" role="button" title="prod_example_1.JPG" alt="prod_example_1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I attach 3 sample sheets as well as an example qvf. Example_3 is the data attached to CCCCCCCC.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What I don't understand is why when I bring in example data it returns the correct result but when I look at the same registration in the production app I do not get a result. I would appreciate it if you could let me know if there is something&amp;nbsp; else I can do to resolve the issue or wh&lt;/SPAN&gt;at else what you think could cause something like this?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 06 Jan 2019 17:06:51 GMT</pubDate>
    <dc:creator>johngouws</dc:creator>
    <dc:date>2019-01-06T17:06:51Z</dc:date>
    <item>
      <title>Mileage at max datetime</title>
      <link>https://community.qlik.com/t5/App-Development/Mileage-at-max-datetime/m-p/1520332#M37228</link>
      <description>&lt;P&gt;Hi. I need to calculate when vehicles are nearing their service mileage. I am getting the latest mileage of the vehicle from certain event logs. These events are timestamped. The data is as below: The highlighted line is the correct value I am looking for. I would prefer to have the result in a Dimension rather than a Measure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Data.png" style="width: 520px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/2101i7613086CFA96A423/image-size/large?v=v2&amp;amp;px=999" role="button" title="Data.png" alt="Data.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When I use&amp;nbsp;"Num(AGGR(max({&amp;lt;[Departure DateTime]={'$(=max([Departure DateTime]))'} &amp;gt;}[End OdoMeter]),[Registration Number]),'# ##0')" it returns the max odometer for all the registration numbers. I need to show the latest odometer reading for each registration number. What am I doing wrong?&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="current2.png" style="width: 342px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/2102i980B0E0F82371593/image-size/large?v=v2&amp;amp;px=999" role="button" title="current2.png" alt="current2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for the assistance.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 10:56:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Mileage-at-max-datetime/m-p/1520332#M37228</guid>
      <dc:creator>johngouws</dc:creator>
      <dc:date>2018-12-13T10:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: Mileage at max datetime</title>
      <link>https://community.qlik.com/t5/App-Development/Mileage-at-max-datetime/m-p/1520362#M37230</link>
      <description>&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;Could you help us providing the example qvf file?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mohan.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 11:32:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Mileage-at-max-datetime/m-p/1520362#M37230</guid>
      <dc:creator>mohan_1105</dc:creator>
      <dc:date>2018-12-13T11:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: Mileage at max datetime</title>
      <link>https://community.qlik.com/t5/App-Development/Mileage-at-max-datetime/m-p/1520377#M37232</link>
      <description>&lt;P&gt;Try this may be&lt;/P&gt;&lt;PRE&gt;Num(Aggr(FirstSortedValue([End OdoMeter], -[Departure DateTime]), [Registration Number]), '# ##0')&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Dec 2018 12:03:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Mileage-at-max-datetime/m-p/1520377#M37232</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-13T12:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Mileage at max datetime</title>
      <link>https://community.qlik.com/t5/App-Development/Mileage-at-max-datetime/m-p/1520605#M37261</link>
      <description>&lt;P&gt;Sunny - thank you very much. EXACTLY what I was looking for.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I now need to site and figure what your exp does &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 16:24:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Mileage-at-max-datetime/m-p/1520605#M37261</guid>
      <dc:creator>johngouws</dc:creator>
      <dc:date>2018-12-13T16:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: Mileage at max datetime</title>
      <link>https://community.qlik.com/t5/App-Development/Mileage-at-max-datetime/m-p/1526743#M37860</link>
      <description>&lt;P&gt;Hi Sunny.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wonder if I can pick this up again? I have a very strange scenario. The solution you proposed works 100% in a smaller app. As soon as I use the expression in the new prod app it returns no values for some of the vehicles!! In the test app I include with some sample data it works perfectly. My main test registration is CCCCCCCC. I am using "Num(Aggr(FirstSortedValue([End OdoMeter], -[Departure DateTime]), [Registration Number]),'# ##0')" in the attached sample as well as in the main app. This screenshot is from the prod app and it is exactly the same fields names as per the attached example, but fails in prod. BTW, The example data for CCCCCCCC is the same as per this screenshot.&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="prod_example_1.JPG" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/3116iF421C1EF1DDB7899/image-size/medium?v=v2&amp;amp;px=400" role="button" title="prod_example_1.JPG" alt="prod_example_1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I attach 3 sample sheets as well as an example qvf. Example_3 is the data attached to CCCCCCCC.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What I don't understand is why when I bring in example data it returns the correct result but when I look at the same registration in the production app I do not get a result. I would appreciate it if you could let me know if there is something&amp;nbsp; else I can do to resolve the issue or wh&lt;/SPAN&gt;at else what you think could cause something like this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Jan 2019 17:06:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Mileage-at-max-datetime/m-p/1526743#M37860</guid>
      <dc:creator>johngouws</dc:creator>
      <dc:date>2019-01-06T17:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: Mileage at max datetime</title>
      <link>https://community.qlik.com/t5/App-Development/Mileage-at-max-datetime/m-p/1526761#M37861</link>
      <description>&lt;P&gt;I don't see a qvf attachment... did you zip the qvf before attaching them? This may be needed because qvf cannot be directly uploaded to the community website.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 00:43:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Mileage-at-max-datetime/m-p/1526761#M37861</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-01-07T00:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: Mileage at max datetime</title>
      <link>https://community.qlik.com/t5/App-Development/Mileage-at-max-datetime/m-p/1526764#M37862</link>
      <description>&lt;P&gt;Thanks for this info. I did not know it had to be zipped. This is the example qvf.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 01:06:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Mileage-at-max-datetime/m-p/1526764#M37862</guid>
      <dc:creator>johngouws</dc:creator>
      <dc:date>2019-01-07T01:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: Mileage at max datetime</title>
      <link>https://community.qlik.com/t5/App-Development/Mileage-at-max-datetime/m-p/1526918#M37873</link>
      <description>&lt;P&gt;Hi Sunny. This expression is giving me the results I am expecting.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Aggr(FirstSortedValue( aggr(max(distinct [End OdoMeter]),[Registration Number],[Departure Date]), Aggr(-[Departure Date],[Registration Number],[Departure Date])), [Registration Number])&amp;nbsp;&lt;/P&gt;&lt;P&gt;My only concern is that it takes longer than previously to calculate the table. I&amp;nbsp;recently upgraded to November 2018 Patch 2 and since then it seems to be slower - but I am not sure if it is my imagination! Can you maybe see a more 'efficient' way of writing this expression?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 10:19:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Mileage-at-max-datetime/m-p/1526918#M37873</guid>
      <dc:creator>johngouws</dc:creator>
      <dc:date>2019-01-07T10:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: Mileage at max datetime</title>
      <link>https://community.qlik.com/t5/App-Development/Mileage-at-max-datetime/m-p/1527160#M37891</link>
      <description>&lt;P&gt;How about if you try this&lt;/P&gt;&lt;PRE&gt;=Num(Aggr(&lt;FONT color="#FF0000"&gt;NODISTINCT&lt;/FONT&gt; FirstSortedValue([End OdoMeter], -[Departure DateTime]), [Registration Number]),'#&amp;nbsp;##0')&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Jan 2019 15:34:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Mileage-at-max-datetime/m-p/1527160#M37891</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-01-07T15:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: Mileage at max datetime</title>
      <link>https://community.qlik.com/t5/App-Development/Mileage-at-max-datetime/m-p/1527197#M37893</link>
      <description>&lt;P&gt;Thank you for this solution. It returns a similar result to the original solution. I am going to stick to the current solution. I think my problem is actually a data quality issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for all your trouble.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 16:15:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Mileage-at-max-datetime/m-p/1527197#M37893</guid>
      <dc:creator>johngouws</dc:creator>
      <dc:date>2019-01-07T16:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: Mileage at max datetime</title>
      <link>https://community.qlik.com/t5/App-Development/Mileage-at-max-datetime/m-p/1527223#M37896</link>
      <description>Sounds good.</description>
      <pubDate>Mon, 07 Jan 2019 16:51:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Mileage-at-max-datetime/m-p/1527223#M37896</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-01-07T16:51:38Z</dc:date>
    </item>
  </channel>
</rss>

