<?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>calculate years from given days</title><link>https://community.appian.com/discussions/f/data/27289/calculate-years-from-given-days</link><description>Please suggest 
 how can we calculate years given by days using record types</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: calculate years from given days</title><link>https://community.appian.com/thread/146306?ContentTypeID=1</link><pubDate>Mon, 17 Mar 2025 16:40:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f055e186-f1dd-42f9-a78a-c965a444cbe3</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/25.1/custom-record-fields.html#extract-partial-dates-(sync-time-evaluation)"&gt;https://docs.appian.com/suite/help/25.1/custom-record-fields.html#extract-partial-dates-(sync-time-evaluation)&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: calculate years from given days</title><link>https://community.appian.com/thread/146303?ContentTypeID=1</link><pubDate>Mon, 17 Mar 2025 15:26:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:196c415e-6e0c-4cfe-bae4-b4537fd33630</guid><dc:creator>Chris.Gillespie</dc:creator><description>&lt;p&gt;That was it!!!!&amp;nbsp; Thanks Simbu!!!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: calculate years from given days</title><link>https://community.appian.com/thread/146302?ContentTypeID=1</link><pubDate>Mon, 17 Mar 2025 15:12:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7d75a6a2-751c-4a9d-8699-ffcd519fe71f</guid><dc:creator>Simbu Ramani</dc:creator><description>&lt;p&gt;The error seems like the value is null at&amp;nbsp;fv!row['recordType!CMS Clergy Member Status Report.fields.Age'].&lt;/p&gt;
&lt;p&gt;Could you please do a null check before using the function and test?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: calculate years from given days</title><link>https://community.appian.com/thread/146301?ContentTypeID=1</link><pubDate>Mon, 17 Mar 2025 15:07:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1a94772c-e48c-4bcb-b479-021424a8253b</guid><dc:creator>Chris.Gillespie</dc:creator><description>&lt;p&gt;I did a very similar sort of thing, except now, I have an issue with decimals.&lt;/p&gt;
&lt;p&gt;I have a table of clergy members with birth dates (clergydob) and the date they died (clergydod).&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I couldn&amp;#39;t use a Sync-time evaluation because I need the Today() function.&amp;nbsp; So,&amp;nbsp;I created a Real-time evaluation custom field called Age.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="json"&gt;a!customFieldDivide(
a!customFieldDateDiff(
    startDate: &amp;#39;recordType!CMS Clergy Member Status Report.fields.clergydob&amp;#39;,
    endDate: a!customFieldDefaultValue(
        &amp;#39;recordType!CMS Clergy Member Status Report.fields.clergydod&amp;#39;,
        today()
        ),
    interval: &amp;quot;DAY&amp;quot;
    ),
365.25
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Now, how do I round down?&amp;nbsp; It seems that the function rounddown() is not compatible with a custom field no matter when defining the field, or when displaying its value.&amp;nbsp; I tried to use it in the List column.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="json"&gt;a!gridColumn(
  label: &amp;quot;Age&amp;quot;,
  sortField: &amp;#39;recordType!CMS Clergy Member Status Report.fields.Age&amp;#39;,
  value: rounddown(fv!row[&amp;#39;recordType!CMS Clergy Member Status Report.fields.Age&amp;#39;],0),
  align: &amp;quot;CENTER&amp;quot;
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I received the following error message.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Expression evaluation error at function a!gridField_23r3 [line 51]: A grid component [label="null"] has an invalid value for &amp;quot;columns&amp;quot;. A grid column [label="Age"] has encountered an error. Expression evaluation error at function &amp;#39;rounddown&amp;#39; [line 81]: A null parameter has been passed as parameter 1.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: calculate years from given days</title><link>https://community.appian.com/thread/106997?ContentTypeID=1</link><pubDate>Mon, 23 Jan 2023 14:16:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ff328dec-19f0-45a4-9e02-d59de55aff77</guid><dc:creator>davel001150</dc:creator><description>&lt;p&gt;Days / 365.25,&lt;/p&gt;
&lt;p&gt;It will be off by 1 day in most cases because of the year 2000, which wasn&amp;#39;t a leap year.&amp;nbsp; Don&amp;#39;t know how to factor that in, but this is honestly already more accurate than you need.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: calculate years from given days</title><link>https://community.appian.com/thread/106982?ContentTypeID=1</link><pubDate>Mon, 23 Jan 2023 11:57:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c992e725-3dae-41b9-90cb-eae90d7a705c</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;That function returns an interval as described in the documentation. Turning that into an integer returns the number of days. Divide that by 365 and you should get a not very&amp;nbsp;reliable age.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>