Start a new topic
Answered

wildcard or contains: cost of all items starting with /travel

We have several travel rates in our system on top of sometimes people creating their own.  On some layouts, I need to total the cost of all travel.  I currently have formulas getting the total for each travel rate then another formula totaling those formulas.  It seems excessive when all of the travel rate manufacturer part numbers begin with /travel.  I've tried % and $ as a wildcard to no avail.


Here is the formula I'm trying, abs(.if.documentitems->manufacturerpartnumber="/TRAVEL%".then.documentitems->extendedcost)


Thanks for the help.


Best Answer

For reference: Debra and I were able to achieve this by looking at the first 'x' characters in the part number.

After a bit of trial and error the layout is working perfectly.


To clarify, you wish to total the value of all line items where the manufacturer partner begins with "/travel"


Is this for an internal document? Does it need to display in a field in QuoteWerks, or just display on a layout?


Something like this:

image


Correct.


It is an internal document.  I don't need a field a field to show the summation, I just need a line on like an internal costing layout to show the summation.  Essential there is a section on the layout after all of the lines showing order total, order profit, order margin, and total travel money in all of that.

OK, I think my mockup meets your need.


If you want to have a quick online screensharing session, I'll happily do this for you:https://www.fastsupport.com/704105617


Answer

For reference: Debra and I were able to achieve this by looking at the first 'x' characters in the part number.

After a bit of trial and error the layout is working perfectly.

The if.first command was key.  For my own memory, the ",8" means to look at the first 8 characters in the string and we formatted it as total instead of value so it totaled up the cost of all of those lines.

.if.

(first(documentitems->manufacturerpartnumber,8)="/XTRAVEL")

.then.

documentitems->extendedcost

.else.

0

Login or Signup to post a comment