Lookup record before the current record

  • 0
  • 1
  • Question
  • Updated 6 months ago
  • In Progress
I needed to lookup a values of a record before the record I am currently on.

I created a formula [Record ID#]-1

I created a relationship pointing to the same table with proxy of this formula field

This should point to the record before the current record.

I added the fields I want to pull from the previous record but the data does not show up. When I look at the previous record it's there but its not pulling the values for some reason.

Am I doing anything wrong?

Thanks
Photo of Micro Dev

Micro Dev

  • 834 Points 500 badge 2x thumb

Posted 6 months ago

  • 0
  • 1
Photo of Drew

Drew

  • 432 Points 250 badge 2x thumb
the record ID of any new record is not created until the record is saved for the first time.  so, you probably want the self-relationship to include a summary field which is 'MAX - Record ID', so that you know the largest Record ID# CURRENTLY in existence
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 53,762 Points 50k badge 2x thumb
You have the disadvantage of knowing SQL :)
Photo of Micro Dev

Micro Dev

  • 834 Points 500 badge 2x thumb
Yup... :)

How about looking up the maximum Call ID but only until the current record. That will always show the call ID before the current one but only if it exists. Any way to lookup maximum only if its less than the current call id?

Thanks again
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 28,304 Points 20k badge 2x thumb
>Quick Base does not loop in a traditional sense of my Fortran days

Well you are in luck Mark as being an engineer and knowing FORTRAN a new feature called WASM will allow you to use FORTRAN with QuickBase once WASM is widely supported. WASM will eventually allow almost any language to inter-operate with the Web.

Until WASM lands use JavaScript.

Awesome WebAssembly Languages Awesome
WebAssembly, or wasm for short, is a low-level bytecode format that runs in the browser just like JavaScript. It is designed to be faster to parse than JavaScript, as well as faster to execute which makes it a suitable compilation target for new and existing languages. This repo contains a list of languages that currently compile to or have their VMs in WebAssembly(wasm)
https://github.com/appcypher/awesome-wasm-langs
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 53,762 Points 50k badge 2x thumb
I can't picture how that could work.maybe there is a solution if there was a table of all the record ID's, but I have not thought this though.
Photo of Micro Dev

Micro Dev

  • 834 Points 500 badge 2x thumb
I have a table that has all record ID's.