Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

Display only last 4 digits of National Identifier

Received Response
76
Views
4
Comments
JHaden3
JHaden3 Rank 3 - Community Apprentice

OBIEE - Would someone please help with a formula to display only the last 4 digits from this social security number field?  The field name is "Worker"."Primary National Identifier Number"

Example:  change 123-45-6789  to 6789.  Thanks!

Answers

  • Srinivas Malyala-Oracle
    Srinivas Malyala-Oracle Rank 4 - Community Specialist

    SUBSTRING("Worker"."Primary National Identifier Number" FROM LENGTH("Worker"."Primary National Identifier Number")-3 FOR 4)

  • JHaden3
    JHaden3 Rank 3 - Community Apprentice

    Thank you so much for your quick response.  You made my day!

  • Simpler and shorter: RIGHT("Worker"."Primary National Identifier Number", 4)

    When you click on the "f(...)" button in the formula editor you can easily see available functions (in categories, with a short description of the function and parameters).

  • [Deleted User]
    [Deleted User] Rank 2 - Community Beginner

    +1 to Gianni's solution. Why  use two nested functions that have to be parsed for every single record if RIGHT does the same job.