Calculating the difference between values on separate days

Gaz Maw
Gaz Maw Member
edited December 2023 in General

Hi,

I have created a grouped output which counts the number of loans per day as below.

How do I calculate the difference between the number of loans each day? i.e. the difference between 16th and 17th Aug would be 35 .. and so on for each subsequent day?

I can’t find any examples or functions that do this.


Best Answer

  • Gaz Maw
    Gaz Maw Member
    Answer ✓

    Thanks Josh, this really helped.

    Apologies for the delay in responding. Your help is much appreciated.

Answers

  • Josh Boxer
    Josh Boxer Administrator

    Hi Gaz

    You could try something like this it uses Current Row (to get the row number) then Subtract one = previous row

    Get cell function will get the cell relative to the current one, so in this case: previous row, same column

    Subtract one value from the other:

    Note since there is no row zero the first cell will show as invalid. You could use If then else function to set than as blank if required.

  • Josh Boxer
    Josh Boxer Administrator

    if you wanted to do this by date rather than cell/row position

    Transform to add a new_date that Subtracts 1 from the date in created_date

    Lookup the value in that same row as new_date

    Subtract the lookup column value from your count column value