I'm working on an app to take meter readings ...

ux
(Chris Houser (Briarfox)) #1

I’m working on an app to take meter readings and I am unsure how to handle grabbing certain rows of data from a list. I have a parent/child relationship, one-many. The problem is, I need to find the difference between each consecutive child entry. How can I grab the two most recent rows for the given id? I’d also like to display the most recent row with the parent in table view.

example: Parent table [id,name] 1, Unit 1 2, Unit 2

Child table [id, meter reading, Virtual col Difference] 1, 0, 0 2, 300,0 1,100,100 1,1000, 900 1, 1500, 500 2, 500, 200 etc

(Syed Faheemuddin) #2

A similar one is here. You may get some idea

https://plus.google.com/102428506309964398456/posts/92zYhqRmUEF Hi Team, I am working on the Vehicle Log Sheet App that lets drivers select … plus.google.com

(Chris Houser (Briarfox)) #3

@Sdfaheemuddin Thanks! I’ll give it a go.

(Chris Houser (Briarfox)) #4

@Sdfaheemuddin

*Edit Easily Fixed with an AND(). Please ignore this.

Unfortunately, not going to work for my use case. I am only storing one value [Reading] for each time the meter is read. I need to populate the virtual col [Previous] with the previous [Reading]. If I could find a way to use MAXROW on a date < [_THISROW].[Date]