ash1474 Posted March 21, 2018 Posted March 21, 2018 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
Lee Smith Posted March 21, 2018 Posted March 21, 2018 What's are you wanting this calculation to do? The result shown in the field is hit and miss on what it is displaying.
ash1474 Posted March 21, 2018 Author Posted March 21, 2018 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.
Lee Smith Posted March 21, 2018 Posted March 21, 2018 This sounds like a timesheet, have you tried Start Date and End Date and elapsed time?
Aussie John Posted March 22, 2018 Posted March 22, 2018 It is getting an error on the first entry for each ID where there is no Nth record to get the previous date from.
ash1474 Posted March 22, 2018 Author Posted March 22, 2018 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.
Aussie John Posted March 22, 2018 Posted March 22, 2018 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
ash1474 Posted March 22, 2018 Author Posted March 22, 2018 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
Aussie John Posted March 22, 2018 Posted March 22, 2018 (edited) 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, 2018 by Aussie John 1
ash1474 Posted March 23, 2018 Author Posted March 23, 2018 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 )
Recommended Posts
This topic is 2703 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now