Jump to content

Date calculation in portal (remove ?)


This topic is 1599 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by Aussie John
  • Thanks 1
Link to comment
Share on other sites

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 )

datecalc.JPG.df7720e6b271f5c5fb35a2a3ac4113dc.JPG

Link to comment
Share on other sites

This topic is 1599 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.