In the annualloadbook app we have users own equipment and I want to add a depreciation table so when the user
1. adds an asset
2 Cost of asset
User selects years of depreciation
The app will calculate the percent of depreciation from the “Depreciation_Enum” Table for the appropriate years selected automatically by the purchase date or date added and show the current depreciation amount and subtract it from the value of the asset till it reaches 0 value at the end of the schedule.
could someone help me get started with an expression example to achieve this
HI @Jack_Bates
My advice, if you’re experienced with Google Sheets, is to use a formula in Google Sheets first, with values that will be affected by dynamic data, such as those you want interactively if the year is changed. AppSheet reads data from the table you provide. To speed up the app creation process, create a table that already contains data so AppSheet can predict the column type you want. If it doesn’t match, you can change it. This method is faster than creating an app in AppSheet with an empty table.
From the description it sounds that the deprecation calculation is yearly.
So you could do it with a daily scheduled bot that calculates the depreciated value of an asset which has become 1, 2, 3, 4, 5,6 or 7 years old on that day.
But before going towards a scheduled bot, you could start with an action to ensure all works as intended.
I would personally construct the “Deprecation_Enum” table in a better data format something like below. I believe this gives a better expression easiness to query the deprecation percentage based on the deprecation plan and years elapsed since the [Acquired Date] of the asset.
The [Deprecation_Plan_Elapsed_Years] column creates a kind of a unique key to query the deprecation percentage based on the plan and elapsed years.
You could then create a data change action called something like “Calculate deprecation” based on the two tables. if you let us know how exactly your are calculating depreciation amount each year, I mean the relevant formula based on the columns you have in the Depreciation table, we could suggest you a most appropriate expression.
It is of course known that based on the depreciation plan and the elapsed years, the corresponding depreciation percentage value needs to be extracted from the Depreciation_Enum table.
The depression takes the first year and subtracts the total of the depression from the purchase price.
Then it subtracts the second year depression from what’s left until it reaches $o
Im working on what you said and will post it here and explain better
I want the app to basically do it automatically by what the user sets the price and the number of years to depression.
The app will have to on the last day of the year run that first year, then the second on the next last day of the year.
Right now in the app if they sell the unit they mark in as NO MORE. that could stop the depression for that unit
Thank you for the update. Please post back if you need any other inputs.