You are viewing limited content. For full access, please sign in.

Question

Question

change a positive value in to a negative value

asked on July 17, 2017

I have a workflow that is using multi-value tokens with dollar values retrieved via pattern matching on an invoice. Some of the Invoices are a Credit but the values are still in positive. How can is change the token values to be negative?  I tried using the 'Assign Token Values' and then adding '-' as a prefix. This only seemed to work for the first value. 

There also some instances where I will need to change a negative value to a positive. I think I can do this simply through pattern matching and excluding the '-' symbol.

 

0 0

Replies

replied on July 19, 2017

If it is only working for your first one, there is probably something that needs to be changed in your For Each Value loop.  Can you send screenshots of how the loop is set up and how you have the assign token set up inside the loop?

1 0
replied on July 17, 2017

You should be able to do this pretty easily by adding a Token Calculator activity. All you need is to put in for the expression is something like: -1 * %(Token)

Then assign the expression value back to the token. Also, be sure to set some kind of numeric tag on the token instead of the string default so it evaluates correctly.

The nice thing about this is that it will convert negative to positive or positive to negative. I wouldn't go the pattern matching routing since that is technically string editing and not math.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.