Forum Discussion

VanessaStone's avatar
VanessaStone
Qrew Member
5 years ago

Previous Function in Reports

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)

3 Replies

  • 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.
  • Did you figure this out, I need to do something similar.

    ------------------------------
    Steve Nelson
    ------------------------------
    • MarkShnier__You's avatar
      MarkShnier__You
      Icon for Qrew Legend rankQrew Legend
      The previous answer to your post was correct.

      ------------------------------
      Mark Shnier (YQC)
      Quick Base Solution Provider
      Your Quick Base Coach
      http://QuickBaseCoach.com
      mark.shnier@gmail.com
      ------------------------------