Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Topic: select specific row of data Posted: 20 May 2013 at 8:07am
i have a field that i'm using a date selection on to choose which row of data to show currently. it works as it should. However, if i want to choose the row above it for another formula how would i do that?
i can write a simple formula to show me the most recent one (if ({date}) > some date then {rate}) which is what i have but what would i do to see the row above it?
Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Posted: 20 May 2013 at 8:30am
I'm not sure that will work or how to do it actually. what my client is looking for is if an employee got a raise which would be indicated by the active date beside the rate then they want to see the difference it makes in yearly salary.
i can get the employee salary by taking the active rate * default hours * pay frequency.
the only thing i'm not sure of is how to make a similar formula to say rate before the active rate * default hours * pay frequency.
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Posted: 20 May 2013 at 10:45am
if your data is ordered by date, and you want the rate from the date before the current line, there is the PREVIOUS() function which will look back 1 row in the dataset.
There is 1 caveat that I am aware of...namely, it doesn't care about groupings, so extra caution is needed for that case.
Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Posted: 21 May 2013 at 2:30am
i'm trying to see if PREVIOUS() will be the way for me to get what i need but i'm not really seeing it work. not every employee will have multiple rates so the previous function seems to be pulling the record above that may not be for that employee.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum