Skip to main content
Question

Previous Function in Reports

  • Jul 16, 2019 11:41 PM UTC
  • 0 replies
  • 54 views

I need a report formula that calculates the difference between the value of a record and the value of the previous record (based on sequential dates). My field is "Sub A Kwh" and the following numeric formula gives a syntax error and the Previous() or PreviousValue() functions aren't recognized.

([Sub A Kwh])-([Sub A Kwh],-1)
This topic has been closed for replies.

  • Observing
  • Jul 29, 2019 7:37 PM UTC
This isn't something that's supported in Quick Base's formula structure as the records are not 'self-aware'. If you're trying to calculations to compare data from different date periods (each represented by a single record), you would have to build a 'looping' relationship on that table that would be used to connect the current record to the previous record. The easiest way is to have a date field as your key field for the table. You can then create a formula that would determine the correct date for the "Previous Week" (for example). You would then need a Form Rule that would push the formula's value to the reference field for the relationship when the record is saved. You'd then be able to create lookup/summary fields as necessary and use those in formulas.

Forum|alt.badge.img+3
Did you figure this out, I need to do something similar.

------------------------------
Steve Nelson
------------------------------