Skip to main content
Participating Frequently
September 5, 2024
Answered

Help me please before I lose my mind 😂

  • September 5, 2024
  • 2 replies
  • 2415 views

Hi, 

 

I was wondering if anyone could help. I am trying to create a formula that pulls through on to the attached.

 

I need the monthly payment amounts to calculate based on different rates. As per the table at the bottom of the document. This is based on the dropdown selected. This would then need to follow with a calculation of Cost*thefield/100.

 

Are you able to help?

 

Cheers

Chris

This topic has been closed for replies.
Correct answer Nesa Nurani

Nesa, I am so sorry to be a pain. I am struggling again with the calculation for the Tax Relief and Net Cost After Tax Relief parts of the documents. I have tried using simplified but this is not working.

 

Tax Relief

I need the below to calculate.

2year_Weekly*104 then I need the box to show 20% of the value calculated

3year_Weekly*156 then I need the box to show 20% of the value calculated

4year_Weekly*208 then I need the box to show 20% of the value calculated

5year_Weekly*260 then I need the box to show 20% of the value calculated

 

Net Cost After Tax Relief

 

This is just Tax Relief - Cost

 

Im so sorry to keep pestering you. I really appreciate your help.

 

Cheers

Chris


Simplified field notations are 'sensitive' to field names, which can't start with a number, contain space character...etc, you need to escape it with a backslash, and to show 20% multiply result by 0.2, try this as simplified field notation: \2year_Weekly*104*0.2

2 replies

PDF Automation Station
Community Expert
Community Expert
September 5, 2024

First, remove all your simplified field notations.  They have errors.  Next, change the export value of "New Business Under £5K+VAT" in the dropdown from 1000 to 1.  This is script a custom calculation script for the 2-year monthly payment field.  You will have to modify it for the other monthly payment fields:

 

var type=this.getField("Business_Type").value;
var cost=this.getField("Cost").value;
if(type==1)
{event.value=this.getField("NewStartU52Y").value*cost/1000;}
else if(type==2)
{event.value=this.getField("NewStartO52Y").value*cost/1000;}
else if(type==3)
{event.value=this.getField("EstU52Y").value*cost/1000;}
else if(type==4)
{event.value=this.getField("EstO52Y").value*cost/1000;}
else
{event.value=""}

 

Nesa Nurani
Community Expert
Community Expert
September 5, 2024

Sure, we can help if you can describe how exactly calculation should go?

Cjj1984Author
Participating Frequently
September 5, 2024

Hi Nesa,

 

Thanks for replying. The dropdown has 4 options. I would need the calculation to pull the correct base rate from the table at the bottom of the document. This would then calculate the monthly payment based on the cost inputted. This calculation would be the Cost x Rate (in table at foot of document /1000.

 

Cheers

Chris

Cjj1984Author
Participating Frequently
September 5, 2024

Remove simplified field notations from weekly fields, rename field "5year-Weekly" to "5year_Weekly", now put this script in any text field as custom calculation script, it will calculate all four weekly fields if you did changes I mentioned above:

for(var i=2; i<=5; i++){
 var month = Number(this.getField(i+"year_Monthly").valueAsString);
 var week = this.getField(i+"year_Weekly");
if(month != 0)
 week.value = month*12/52;
else
 week.value = "";}

Nesa, I am so sorry to be a pain. I am struggling again with the calculation for the Tax Relief and Net Cost After Tax Relief parts of the documents. I have tried using simplified but this is not working.

 

Tax Relief

I need the below to calculate.

2year_Weekly*104 then I need the box to show 20% of the value calculated

3year_Weekly*156 then I need the box to show 20% of the value calculated

4year_Weekly*208 then I need the box to show 20% of the value calculated

5year_Weekly*260 then I need the box to show 20% of the value calculated

 

Net Cost After Tax Relief

 

This is just Tax Relief - Cost

 

Im so sorry to keep pestering you. I really appreciate your help.

 

Cheers

Chris