phastings's profile

2 Messages

 • 

45 Points

Friday, June 14th, 2024 8:53 PM

Filtering on no error message in Price Method

I’m using a UPE method, and have a Warning2 text string that either has one of many possible text values, or “” if no warning conditions are met:

 

WARNING2 =

IF([FINAL_PRICE]=-1,"",

CONCATENATE(

    IF([FINAL_PRICE]>[LIST],"Price > List, ",""),

    IF([FINAL_PRICE]>[STANDARD PRICE],"Price > StdPrice, ",""),

    IF([FINAL_PRICE]<ROUND([COST],2),"Price < Cost, ",""),

    IF([PRICE_OLD]=-1,"New SKU","")))

  

I want to be able to filter in UI on “Warning 2 is not “”   “ – to isolate lines that have warning text strings that are not “”, but I can’t seem to get it to work. Any suggestions?

 

I like using “” in formula as the default for no warning, as looks clean in UI and in excel exports, so want to avoid re-writing the default to be some special character.

Accepted Solution

1 Message

 • 

10 Points

6 months ago

Hello @phastings,

Reading your current formula, it looks like you are familiar with our legacy evaluation engine which did not have support for the absence of a value. Luckily, it looks like you are using our latest cloud features with the Unified Pricing Engine (UPE) which does! In the UPE, we have native support for and prefer the use of "NULL" for the absence of value, better functions for text modification, and native support for Boolean data types which you will find in the modified formula below. With this formula, you will be able to use the "is empty" and "is not empty" filter criteria in your price list instead of trying to find some placeholder string.

Modified Formula:

IF(
    IS_NULL(TRYINORDER([FINAL_PRICE]), /*Handles the situation that final price is null or errored instead of a placeholder value*/
    NULL(""), /*Intentionally returns a NULL value*/
    JOIN(
        ", ", /*Joins all of the results together when there are more with no trailing commas (,)*/
        IGNORE_NULL, /*Tells the function to not concatenate anything when the IF()s below return NULL*/
        IF( [FINAL_PRICE]>[LIST], "Price > List", NULL("")),
        IF( [FINAL_PRICE]>[STANDARD PRICE], "Price > StdPrice", NULL("")),
        IF( [FINAL_PRICE]<ROUND([COST],2), "Price < Cost", NULL("")),
        IF( [PRICE_OLD], "New SKU", NULL("")) /*Price old can become a Boolean true or false instead of an indicative number */
    ) /*If none of the conditions have a value this will return a NULL so no need to manually check for it*/
)

Thanks for posting!

2 Messages

 • 

45 Points

Thanks Rob!

  NULL, along with JOIN solved the issue and I can now use the Empty/Not Empty filter options.