Scenario Overview

In this scenario we will demonstrate how to set up a simple Decision Table to convert short-hand notation into numeric values.

Sales agents working on the Opportunity entity want to just type 3.4m into a custom field and have the Estimated Revenue field be updated to 3400000.

This example will take account of the following letters

  • k, K - Thousand
  • m, M - Millions
  • b, B - Billions

The reason we do this in a Decision Table is that it can easily be expanded to accommodate additional short hand notation like mi, mil, g, ks etc. as needed by just adding an additional Calculation and Action for each of them.

The Formula Manager solution works like this:

  • A formula of type Save - To Current Record is created on the Opportunity entity
  • The Source Property is set to 'Short Revenue'
  • The Target Property is set to 'Est. Revenue'
  • The Event is set to 'Create & Update'
  • Exit on First Match is turned On (checked)

    Calculations Table

    The Calculations Table has 3 calculations in this Decision Table:

    • FoundLetterK - Looks for the letter K (thousands)
    • FoundLetterM - Looks for the letter M (millions)
    • FoundLetterB - Looks for the letter B (billions)

    Calculations : 

    If(IndexOf(Upper([opportunity.new_shortrev]), 'K', '0')  > 0, true, false)
    If(IndexOf(Upper([opportunity.new_shortrev]), 'M', '0')  > 0, true, false)
    If(IndexOf(Upper([opportunity.new_shortrev]), 'B', '0')  > 0, true, false)



    The Actions tab has 3 actions on this Decision Table
    • K Multiply 
    • M Multiply
    • B Multiply

    The Trim() function removes the small letter or Capital letter from the end of the number e.g. 35.6k becomes 35.6.
    Truncate() is used to remove an any unnecessary zeros after the decimal place.


    K Multiply
    Truncate(Trim( [opportunity.new_shortrev], 'k', 'K') * 1000)
    M Multiply
    Truncate(Trim( [opportunity.new_shortrev], 'm', 'M') * 1000000)
    B Multiply
    Truncate(Trim( [opportunity.new_shortrev], 'b', 'B') * 10000000000)


    The Decision Table

    In the screenshot below you can see that the Conditions and Actions have been added to the Decision Table.

    If FoundLetterK returns true, then the Decision Table will execute K multiply etc.

    Did you know?

    xCache helps you manage environment specific configuration

    North52's Decision Suite component xCache allows you to set up environment specific data to allow you to use different values for different instances. Your advanced business rules logic could be the same, however you need to use specific reference values for a particular instance.

    For example, credentials for a web service used in your Formula - you will likely use different keys/URLs for your Dev, Test and Production instances. Store these in xCache and let the North52 business rules engine apply the correct ones at runtime! 

    Learn more and see examples of xCache