Trying to do this calculation that involves 2 pieces of metadata, as part of a multi-line with variables, for an email body. I can't seem to find the right formatting. I either get nothing but "Shortage % %", or I get the entire formula exactly as it is below. How do I format those 2 pieces of metadata to be resolved as numbers, in an equation?
Shortage %: [Switch.Calculation:Expression="((1-(["Metadata.TextIndexed:Path="/field-list/field[tag='Quantity Good']/value",Dataset="Submit",Model="XML"]/["Metadata.TextIndexed:Path="/field-list/field[tag='Quantity Ordered']/value",Dataset="Submit",Model="XML"]))*100)"] %
Math Expressions With Metadata
Re: Math Expressions With Metadata
Your calculation formula worked for me, but I used PrivateData for the values since it was easier to set up for testing.
I see that you have the Metadata as TextIndexed try instead with just Text
I see that you have the Metadata as TextIndexed try instead with just Text
-
- Member
- Posts: 37
- Joined: Tue Jun 01, 2021 11:57 am
Re: Math Expressions With Metadata
[Switch.Calculation:Expression="((1-(["Metadata.TextIndexed:Path="/field-list/field[tag='Quantity Good']/value",Dataset="Submit",Model="XML"]/["Metadata.TextIndexed:Path="/field-list/field[tag='Quantity Ordered']/value",Dataset="Submit",Model="XML"]))*100)"]
Code: Select all
[Switch.Calculation:Expression="
(
(
1-(
["Metadata.TextIndexed:Path="/field-list/field[tag='Quantity Good']/value",Dataset="Submit",Model="XML"]
/["Metadata.TextIndexed:Path="/field-list/field[tag='Quantity Ordered']/value",Dataset="Submit",Model="XML"]
)
)
*100
)
"]