On the attached ddsp, I need to sum the AECProjInvoiceProgressTmp/@PreviousBilling and AECProjInvoiceProgressTmp/@PendingBilling fields but only include lines where the AECProjInvoiceProgressTmp/@ContractValue field is not 0.
I would’ve sat longer to try and figure this out but testing is about to start and I’ve run out of time.
I’m not quite sure if I understood your case correctly. If not, please let me know.
This will require a slight adjustment to our approach from the manual, where we manually calculate the running total.
In the first step, I will add a new var tagging element near the beginning of the document, similar to how variables are declared in programming, with an initial value of 0. I will name it ‘SUMBilling’.
Then, inside the group tagging element, I’ll add the same var tagging element with the same name. However, instead of setting it to zero, I’ll use an XPath expression to sum AECProjInvoiceProgressTmp/@PreviousBilling and AECProjInvoiceProgressTmp/@PendingBilling. Since the filter ensuring AECProjInvoiceProgressTmp/@ContractValue is not 0 is already applied at the group level, I’ll skip that part.
This will ensure that for each line, the calculation will be done separately, and the sum will then be stored for each line within the var tagging element.
Once all the lines are calculated and we are outside the group tagging element, we can add a field tagging element to display the final result.
However, we would need to use the following XPath expression.
Apologies, I should have clarified further - I need the sum total of the previous billing in the subtotal line, and the sum total for the pending billing in the subtotal line. Like adding up the column total.
Currently the total for the current billing is $22,000.00, but if you add the column that’s not correct. It’s because it adds in the current billing for the lines where the contract value is 0. Those lines are not displayed, and I need to exclude them from the total.
This will result in the sum of the field values, the current billing values with in the group tagging element. You could do the same for PreviousBilling, but you will need to add an additional var tagging element to cover this calculation.