Skip to main content
Participant
April 3, 2023
Question

Table Calculations

  • April 3, 2023
  • 1 reply
  • 2410 views

Hi, I am needing some assistance with making calculations for the table below.  The issue I'm having, is I can't just use a numeric calculation as the same number could yield different results.  I'm needing to know the calculation to enter to calculate "Risk Profile" and as a word, ie. "Passive Income" "Conservative" "Moderate" "Growth" or "Aggressive" Can anyone help?  Thank you in advance!!

 

This topic has been closed for replies.

1 reply

bebarth
Community Expert
Community Expert
April 3, 2023

Hi,

Here is a proposal in custom calculate script:

 

var ths=[[0,2],[3,5],[6,7],[8,9],[10,19]];
var rts=[[0,8],[9,23],[24,38],[39,53],[54,60]];
var rp=[["Passive Income","Passive Income","Passive Income","Passive Income","Passive Income"],["Passive Income","Conservative","Conservative","Conservative","Conservative"],["Passive Income","Conservative","Moderate","Moderate","Moderate"],["Passive Income","Conservative","Moderate","Growth","Growth"],["Passive Income","Conservative","Moderate","Growth","Very Agressive"]];
for (var i=0; i<ths.length; i++) {
	if (this.getField("timeHorizonScore").value>=ths[i][0] && this.getField("timeHorizonScore").value<=ths[i][1]) break;
}
for (var j=0; j<rts.length; j++) {
	if (this.getField("riskToleranceScore").value>=rts[j][0] && this.getField("riskToleranceScore").value<=rts[j][1]) break;
}
event.value=rp[i][j];

 

@+

Participant
April 3, 2023

Hi bebarth,

I will get working on this!  Thank you SO much!!!

Mark

Participant
April 4, 2023

Hi bebarth,

Absolutely happy to share the file!  I wasn't sure how to attach it in the pm so I've attached here.  Thank you!!