Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
10 replies
Subscribers
9 subscribers
Views
4154 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
I have 4 columns in a grid. I need the value in the second column divided by the
Frank
over 10 years ago
I have 4 columns in a grid. I need the value in the second column divided by the 3rd column and entered in the 4th column. So if 10000 is the second value and the 3rd column is 400 I need the 4th column autocalculated to 25. See the attached screenshot for assistance.
Divide values in grid.gif
OriginalPostID-139290
OriginalPostID-139290
Discussion posts and replies are publicly visible
0
Lakshmi Meyyappan
over 10 years ago
Since the 3rd column is the denominator in the division, I would use an a!save() on the 3rd column. Something like: a!save(ri!costPerHour, quotient(ri!cost, ri!billableHours)), but you will want to null-check the cost and billableHours values before you try to perform the division.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Lakshmi Meyyappan
over 10 years ago
I just realized you'll probably want to use the same a!save on both the 2nd and 3rd column, so that if either value is changed then the 4th column is updated.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
rodgraham
Certified Lead Developer
over 10 years ago
Looks like this is a non SAIL form - you'd need to change to SAIL to be able to do the suggested. If you can't change to SAIL are you allowed to use javascript? You could try creating javascript rules for this. If not you could split the form into 2 one for entering the Cost and Billable Hours another that then shows the Cost per Hour with the ability to move back to the data entry screen if needed.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Frank
over 10 years ago
This is for version 7.3, we are upgrading to 7.8 but not in time for this project.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Conor Cahill
Certified Lead Developer
over 10 years ago
Since non-SAIL forms don't have the ability to dynamically update values, you'll to do this through a form submission. A solution for this case could be having a button at the bottom of the form saying "Calculate Hourly Costs", and using that button will submit the form, chain through a script task that calculates the hourly costs, and then chains back to the form.
To the end user it doesn't look like they left the form, and now the hourly costs are updated.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Mike Schmitt
Certified Lead Developer
over 10 years ago
If you have 7.3 shouldn't you have the ability to do a SAIL form? Or does 7.3 predate editable grids?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
radhaa
over 10 years ago
If it is a normal grid (not paging grid), you can place JavaScript/Jquery functions as you need (on change, on blur events on 2nd,3rd columns)
1. you can use get value and set value methods to retrieve data from 2nd column, 3rd column by using fieldIds (like FormAPI.setvalue() and get value())
2. define variable by calculating both of them and set that value to the 4th column.
But here the crafty things is to get the index of that row from a dynamic grid view (adding/deleting rows).
If it is fixed set of rows, then just iterate the rows and calculate it using for loop.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
rodgraham
Certified Lead Developer
over 10 years ago
I think the editable grids came in 7.5 -
forum.appian.com/.../Appian_Release_Notes
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Frank
over 10 years ago
I used
quotient(riCost,riBillableHours) saved as Cost per Hour
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Frank
over 10 years ago
Thanks for your help, I never used the quotient function before.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel