JavaScript Help - custom calculation in one field based off value in two other fields
Good morning - I'm trying to figure out how to return the value of a field based off of the values of two different fields where I have a table of data (6 columns, 42 rows). I'm guessing that setting it up in either an array or in an object may be the solution, but not sure how to implement. The fields are:
var s1 = getField("CrimHistory").value;
var s2 = getField("TotalOffenseLevel").value;
var s3 = getField("Min").value;The data I'm looking to return is from this table, where the X axis is TotalOffenseLevel and the Y axis is CrimHistory (columns/rows named for ease of reference only).
I II III IV V VI
1 0, 0, 0, 0, 0, 0,
2 0, 0, 0, 0, 0, 1,
3 0, 0, 0, 0, 2, 3,
4 0, 0, 0, 2, 4, 6,
5 0, 0, 1, 4, 6, 9,
6 0, 1, 2, 6, 9, 12,
7 0, 2, 4, 8, 12, 15,
...
[table is truncated for brevity]
So, if s1 = "II" and s2 = "7", the output in s3 should = "2". Thanks in advance for any assistance you can provide!
