Skip to main content
Solved

Combine 2 calculations to create one field

  • July 27, 2023
  • 4 replies
  • 27 views

Forum|alt.badge.img+5

I am creating an asset register with the current values of assets. I have two formula columns in use to output the current data. 

Wondering if I can combine/nest the two formulas into one? 

This is what I have now, any advice on how I would combine these into one forumla? 

Top row is one column, bottom is the final row with current value. 

 

 

(DATETIME_DIFF(TODAY(), {Purchase Date}, "years") * {Depreciation Percentage} * {Price}) MAX(SUM(Price-{Depreciation}),0)

 

 

 

Best answer by Sho

If the first line is depreciation, it would look like this.

MAX(SUM(Price-(DATETIME_DIFF(TODAY(), {Purchase Date}, "years") * {Depreciation Percentage} * {Price})),0)

4 replies

Forum|alt.badge.img+21
  • Inspiring
  • 560 replies
  • July 27, 2023

You mean like this?

(DATETIME_DIFF(TODAY(), {Purchase Date}, "years") * {Depreciation Percentage} * {Price}) & "\n\n" & MAX(SUM(Price-{Depreciation}),0)

"\n" is the symbol for a new line.


Forum|alt.badge.img+5
  • Author
  • Known Participant
  • 13 replies
  • July 28, 2023

Thanks for your reply @Sho 

I did try this, but it then gives me the two answers in the same column. 

I am looking for the column to only show the current price. So the first line works out the amount the product has depreciated, and the next line works out the current value. 
They are two separate columns, and I was wondering if I can combine the formula in to one column somehow. 


Forum|alt.badge.img+21
  • Inspiring
  • 560 replies
  • Answer
  • July 28, 2023

If the first line is depreciation, it would look like this.

MAX(SUM(Price-(DATETIME_DIFF(TODAY(), {Purchase Date}, "years") * {Depreciation Percentage} * {Price})),0)

Forum|alt.badge.img+5
  • Author
  • Known Participant
  • 13 replies
  • July 28, 2023

If the first line is depreciation, it would look like this.

MAX(SUM(Price-(DATETIME_DIFF(TODAY(), {Purchase Date}, "years") * {Depreciation Percentage} * {Price})),0)

Excellent! Thank you that worked! I just couldn't work out how to put it in to one calculation and it was annoying me having to hide one column rather than just doing it all in one 🙂