Math Expressions With Metadata
Posted: Fri Jun 16, 2023 8:51 pm
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)"] %
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)"] %