Skip to main content

Mapping Manager - @CASE() Function

Micah A. Parker avatar
Written by Micah A. Parker
Updated this week

Product: Mapping Manager

Article Link:


The @CASE() function allows for a series of potential returns checked against a single token. In this way - it allows for a list of potential results based on the initial value of the token it checks against.

@CASE(Condition,Default,If,Then,...)
Condition: Token to check against
Default: Value to use if no match is found
If: Value to compare against the Condition
Then: Value to return if condition equals value
...: Repeats IF, THEN pattern

Examples

Define Discount Percentage Based on Terms

Below is a basic example that applies a default 5% discount, while granting a 4% for NET 60 day terms, and 3% for NET 90 days

@CASE([T:Terms],5%,NET 60,4%,NET 90,3%)

Conditional Based on Trading Partner

Below example shows how you can configure a @CASE() statement to provide a different result based on the Trading Partner and returns no result if the Trading Partner is not listed.

@CASE(I:Trading Partner Name],,Amazon,UPS,Target,FedEx)

Notes

A simple @CASE() statement can easily cleanup a large exhaustive series of nested @IF_THEN_ELSE by simplifying it into a single conditional check, and providing an easy pattern of potential IF-THEN conditions compared to repeatedly recreating the conditional.

@IF_THEN_ELSE([I:Trading Partner Name,=,Amazon,[T:Promotional Allowance],@IF_THEN_ELSE([I:Trading Partnerm Name],=,Walmart,[T:Special Advertising Amount],@IF_THEN_ELSE(I:Trading Partner Name],=,Target,[T:Discount Amount],@IF_THEN_ELSE(I:Trading Partner Name],=,Big Lots,[T:Discount Amount],0))))

Can be simplified into

@CASE([I:Trading Partner Name,0,,Amazon,[T:Promotional Allowance],Walmart,[T:Special Advertising Amount],Target,[T:Discount Amount],Big Lots,[T:Discount Amount])

rev 7/3/2025

Did this answer your question?