Specify Resulting Value for COMPARE Function

0 Kudos

Specify Resulting Value for COMPARE Function

It would be helpful if the COMPARE function could be modified to specify different resulting values.  Currently, the formula returns 0 if there is a match and -1 or 1 if there is a match. Ideally you could specify any values, but returning 1 if there is a match and 0 if there is not a match would provide a useful alternative to long nested IF formulas.

 

For example, if you have five different possible drivers you could write a formula like (Driver 1 Value or Line Item * COMPARE + Driver 2 Value or Line Item * COMPARE + Driver 3 Value or Line Item * COMPARE + Driver 4 Value or Line Item * COMPARE + Driver 5 Value or Line Item * COMPARE).  The user would pick the driver they want to use and each of the COMPARE functions would test if the driver equaled the selected driver.  Only the selected driver would return 1 so the formula would evaluate to the Driver 1 value.

 

The above can currently be accomplished with (1 - abs(COMPARE)) but it isn't as flexible or clean as allowing the user to specifying the resulting value.

1 Comment
New Contributor

Typo in my original post - should have read "Currently, the formula returns 0 if there is a match and -1 or 1 if there is a not a match"

Users Online
Currently online: 75 members 438 guests
Please welcome our newest community members: