here in the image
1st, 2nd and 3rd columns are input and it has to generate the 4th, 5th and 6th column
can anyone help me with this
4th column will be calculated with 3rd column/1st column
5th is minus of 4th column
6th is increment of 1 year
for brief it is a depreciation logic for every year
Discussion posts and replies are publicly visible
hi KM are trying to do this in excel sheet or appian grid filed
doing it in expression rule and result will be stored in DB
Hi KM I am still unable to capture your requirement could you please share your code snippet for better understanding
What do you mean by doing it in expression rule and store in db? Do you want to create an expression rule that performs the calculation?
yes, first 3 columns are input based on input next 3 are calculating- storing to be i do it in the PM
Hello KM I try to mimic your requirement using map function but you can create CDT or Record according to your need and save this into DB.Below is my understandingFor each row, Dividing the value in column D by the value in column B. Then, subtracting column E from the value in column D. Finally, it increments the date in column F by one year.
a!localVariables( local!data: { a!map( "COLB": 5, "COLC": "02/01/2024", "COLD": 10000, "COLE": 2000, "COLF": 8000, "COLG": "01/31/2029" ), a!map( "COLB": 3, "COLC": "02/01/2024", "COLD": 10000, "COLE": 2000, "COLF": 8000, "COLG": "01/31/2029" ) }, a!forEach( items: local!data, expression: a!update( fv!item, { "COLE", "COLF", "COLG" }, { fv!item.COLD / fv!item.COLB, fv!item.COLD - (fv!item.COLD / fv!item.COLB), todate( datetime( year(tostring(fv!item.COLC)) + 1, month(tostring(fv!item.COLC)), day(tostring(fv!item.COLC)) ) ) } ) ) )
the input will be example
years - 5
amount - 10000
initial year - 1st feb 2024
so we have to calculate until amount comes to 0, by incrementing every year
Can we have a stored procedure for this logic will that be easy ?
While loop is not available in Appian expressions , you need to create a process model
While loop in Appian
we are not using the RPA