<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Does Appian has any default function to get the Max/ latest date?</title><link>https://community.appian.com/discussions/f/general/14706/does-appian-has-any-default-function-to-get-the-max-latest-date</link><description>Hi, 
 Does Appian have any defualt function to get the Max/ latest date from a date array if the data is like below? 
 2018-10-26T20:41:55 
 2017-02-26T18:21:39 
 2019-07-26T10:01:21 
 
 Thanks in Advance</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Does Appian has any default function to get the Max/ latest date?</title><link>https://community.appian.com/thread/65904?ContentTypeID=1</link><pubDate>Mon, 15 Apr 2019 18:45:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4f3fdd71-cafc-4ec4-ab43-ed5259adb25a</guid><dc:creator>adithyay</dc:creator><description>&lt;p&gt;Thank you. It worked.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Does Appian has any default function to get the Max/ latest date?</title><link>https://community.appian.com/thread/65903?ContentTypeID=1</link><pubDate>Mon, 15 Apr 2019 18:30:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b7c313a8-a785-42ce-8cf3-ec84a04a8632</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;The attached alternative code sample (which i&amp;#39;ve actually tested this time) will demonstrate how you can manually sort your text array (using officially supported functionality), and using a the specified pagingInfo value, select just the first result automatically (which should be the highest).&amp;nbsp; Let me know if you have any questions.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;with(
  local!array: {
    &amp;quot;2018-12-04T19:24:44&amp;quot;,
    &amp;quot;2017-09-26T20:41:35&amp;quot;
  },
  
  todatasubset(
    a!forEach(
      local!array,
      {
        text: fv!item
      }
    ),
    a!pagingInfo(
      startIndex: 1,
      batchSize: 1,
      sort: a!sortInfo(
        field: &amp;quot;text&amp;quot;,
        ascending: false()
      )
    )
  ).data.text
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Does Appian has any default function to get the Max/ latest date?</title><link>https://community.appian.com/thread/65902?ContentTypeID=1</link><pubDate>Mon, 15 Apr 2019 18:27:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3542a84a-16bc-4d5b-b807-1723478b2ddf</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;My mistake, max() does expect a numeric value.&amp;nbsp; The place I&amp;#39;ve used it for finding the max date from a list is being called on an array of dateTime value.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Does Appian has any default function to get the Max/ latest date?</title><link>https://community.appian.com/thread/65901?ContentTypeID=1</link><pubDate>Mon, 15 Apr 2019 18:20:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f359d58f-040c-4e77-81a6-9d581e7d2815</guid><dc:creator>adithyay</dc:creator><description>&lt;p&gt;Thanks for the suggestion Mike. I tried to use the max function and for (&amp;nbsp;&lt;span&gt;List of Text String: 2 items &amp;quot;2018-12-04T19:24:44&amp;quot; &amp;quot;2017-09-26T20:41:35&amp;quot;) and this is what I got&amp;nbsp;-2.017093e+13&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Does Appian has any default function to get the Max/ latest date?</title><link>https://community.appian.com/thread/65900?ContentTypeID=1</link><pubDate>Mon, 15 Apr 2019 17:43:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d782c648-1d36-4a04-a092-fac81de0003e</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;I believe dates in that format will sort lexically consistently (i.e. a standard &amp;quot;alphabetical&amp;quot; sorting will sort the dates correctly, assuming they&amp;#39;re TEXT and with no other conversion necessary), in which case I&amp;#39;d expect the &amp;quot;max()&amp;quot; function might work for you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>