0

I have a recordset where rows have a date field.Rows are from current year and last year. I want to see the count of rows per year. That's easy. Now I'd like to have a third column with difference (count(currentYear) - count(lastYear)). Is there any way to achieve this?

thanks

Daní
  • 355
  • 1
  • 17

1 Answers1

1

It seems like you want to have the difference calculated between two members of the same date field.

If so, you might want to consider the customizeCell() API call to retrieve the count values of each year, use them to calculate the difference, and modify the necessary cells with the result.

Alternatively, you could try modifying your data set so that the lastYear and currentYear are two different fields – this, for example, would allow you to compare them within a calculated value.

mhalaida
  • 91
  • 1
  • 6
  • @MykhailoHaalida Thanks for your answer. I'd like to use customiceCell() Api function, but I must admit it's been hard to find a clean way to store the values of each year per row... I would appreciate an example – Daní Mar 15 '21 at 18:17
  • 1
    @Daní, my bad, didn't see your response. There isn't really a ready-to-use sample for this, but I think you might find the docs and the existing samples helpful: https://www.webdatarocks.com/doc/customizecell/ – mhalaida Jul 07 '21 at 08:48