Definition of formula field by deluge

Definition of formula field by deluge

Hello everyone,

first happy new year to all community members! Could you please help me with the script how I can define a formula field in a form. This form is for collecting data from general ledger. Data are uploaded (imported) regularly.
I want to calculate some KPI-s. If you can help me with an example, hopefully I can do the others.
I have a field for the general ledger account number, the field name is "fkv"
I have a field for the of the account >>> "fkv_name"
And I have  fields for collecting amounts that are booked in a calendar year >>> amount2020, amount2021 etc.

Let's say I'd like to calculate the difference between the 911 and 814 ledger account in 2020.

Can you help with the script, please?!