Calculation help

I need help figuring out these calculations. I've tried countless was of setting up the tokens as per the documentation only for the fields to be blank and the functionality not to work for me. I don't think i need to change anything in my JSON here, I am in a modern setting mode. Perhaps I am just not understanding the syntax requirements in the documentation. Please help.

I am trying to multiply the # of hours, by the hourly rate on each row of my T&M Rate Structure table colleciton and then output the sum of all Line Item costs to the T & M Estimated Cost cell below. Then on the next page I have discounts or credits that need to be deducted in a separate table and finally the total estimated project cost placed in the Total Estimated Project Cost.

Hi @RDurb,

I'm discussing the Value functions in the Modern engine with the developers and will be in touch a bit later.

Thanks for waiting!

Best regards,
Petr
Plumsail team

Hi @RDurb,

Please check the example and try to adjust your template:

Let's say I have this JSON:

{
  "sales": [
    {
      "price": 3,
      "quantity": 90
    },
    {
      "price": 4,
      "quantity": 60
    },
    {
      "price": 5,
      "quantity": 30
    }
  ]
}
  1. I can calculate Total quantity using the formula:
{{sales|sum(quantity)}}

  1. If I want to calculate Total Amount I can add a new calculated property totalAmount (in the template {{sales.totalAmount = value}}), and then sum it across the entire array (sales)
{{sales.totalAmount = @value.quantity * @value.price}}
Total amount: {{sales|sum(totalAmount)}}

Best regards,
Petr
Plumsail team