# Complex Logic Expression

well… complex for me anyway way

guys, i’m hoping you can help… we have effectively 4 different service points for any one ticket and i currently set a ticket tag on each ticket which counts these, so as to keep the other service points informed.

I want to add a line to my printed service tickets to inform each service point if there is multiple points of service for the one order.

so basically, i want to set a flag on the ticket if at least 2 of the 4 ticket tags have a value greater than 0. If it’s only 1, i don’t care as there is no coordination required.

I can’t seem to get the logic right… I’ve tried variations of the below as constraints on an action:

([=TN(’{TICKET TAG:KitchenCount}’)] > 0) && ([=TN(’{TICKET TAG:BreadCount}’)] > 0 II [=TN(’{TICKET TAG:BarCount}’)] > 0 II [=TN(’{TICKET TAG:PizzaCount}’)] > 0)

but they don’t seem to fire correctly. Any help would be greatly appreciated

Your brackets arnt even

1 Like

A script would solve easily.
Calling a script inputting the 4 counts and script can count the number of I puts larger than 1 and return a value for the constraint to trigger.
Either than or getting creative with some math to make the tags 0 or one and add them together.
Something like tag/100 rounded up
Adding the 4 tags to them mean that total sum large than 1 means multiple tags.
Or failing that a very long constraint with all four combinations ie
(A && (B or C or D) ) OR ( B && (A or C or D) OR etc etc.

Thanks @JTRTech - a script is definitely the solution.

I had the right logic in the equation but the complex constraint is too hard to master i think (at least for me).