Previous Function in Reports

  • 0
  • 1
  • Question
  • Updated 4 weeks ago
  • In Progress
  • (Edited)
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)
Photo of Vanessa Stone

Vanessa Stone

  • 70 Points

Posted 1 month ago

  • 0
  • 1
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.