March 21, 20187 yr Hi, I am using this calculation in portal which calculates days in portal Date - (GetNthRecord ( Date ; Get ( RecordNumber ) - 1 ) ) how can i modify or do something else to avoid (?) in the first row. Sample file attached for any modification/help. Thanks for any help DateCalc.fmp12
March 21, 20187 yr What's are you wanting this calculation to do? The result shown in the field is hit and miss on what it is displaying.
March 21, 20187 yr Author I want the difference between two dates (days). The solution i am working is about submitting applications by person on different dates and report on how many days have past since the last submitted application date.
March 21, 20187 yr This sounds like a timesheet, have you tried Start Date and End Date and elapsed time?
March 22, 20187 yr It is getting an error on the first entry for each ID where there is no Nth record to get the previous date from.
March 22, 20187 yr Author 1 hour ago, Aussie John said: It is getting an error on the first entry for each ID where there is no Nth record to get the previous date from. yep thats the problem. is their any other calculation to get days between dates in portal rows. something like which starts calculating from second portal row and ignore the first row or put the calculation in second row. some calculation like ....Calculate the days between portal rows and don't calculate the first row or blank if dates are same.
March 22, 20187 yr I can’t test this but case(GetNthRecord ( ID ; Get ( RecordNumber ) - 1 ) =ID, Date - (GetNthRecord ( Date ; Get ( RecordNumber ) - 1 ) ), 0) there are probably more elegant solutions
March 22, 20187 yr Author 1 hour ago, Aussie John said: I can’t test this but case(GetNthRecord ( ID ; Get ( RecordNumber ) - 1 ) =ID, Date - (GetNthRecord ( Date ; Get ( RecordNumber ) - 1 ) ), 0) there are probably more elegant solutions the result is always zero 0 i will try the case statement with different setting thanks for helping
March 22, 20187 yr Ash Sorry my error the reference to ID should be person ID ( ID_person) not the Date record ID which is irrelevant Temporarily, to see your results change instantly it helps if Datecalc is unstored Case(GetNthRecord ( Date::id_Person ; Get ( RecordNumber ) - 1 ) =Date::id_Person; Date::Date - (GetNthRecord ( Date::Date ; Get ( RecordNumber ) - 1 ) ); 0) I should add that a change in the sort order will ruin your results. Edited March 22, 20187 yr by Aussie John
March 23, 20187 yr Author Thanks Aussie John for help the case statement solved the problem here is my screenshot of original solution (the dates are local i mean not Gregorian calendar )
Create an account or sign in to comment