Jump to content
Server Maintenance This Week. ×

Calculate percent change between values in sequential portal rows


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

Recommended Posts

I have an Employee Records database, with contains a related table of wage history contained within a portal, which is sorted by date.

Employee - John Doe

Date           Description           Wage         %Change

1/1/2021     Annual Raise        $20.00

1/1/2020    Original Rate        $18.00

I'm trying to create a calculation, which will display the percent difference between the data in the subject portal, and the next portal record in the sequence.  I've created the below calculation, but the results are out of sequence and/or inaccurate.  It appears that my formula is not grabbing the proper values??

 

Let ( Salary1=GetNthRecord ( Wage ; Get (  RecordNumber ) ); Let ( Salary2=GetNthRecord ( Wage ; Get ( RecordNumber ) +1 ); Case(Salary2="";0; (Salary1/Salary2)-1   )))

Link to comment
Share on other sites

I think the calculation could be simply = 

Wage / GetNthRecord ( Wage ; Get (RecordNumber) + 1 ) - 1

This needs to be unstored and formatted as percent. It will produce an error on the last portal row; the simplest solution, IMHO, is to hide the field when

Self = "?"

 

  • Like 1
Link to comment
Share on other sites

This topic is 1021 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
×
×
  • Create New...

Important Information

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