Apptio for All

Apptio for All

A place for Apptio product users to learn, connect, share and grow together.

 View Only
  • 1.  Formula Logic

    Posted Tue August 02, 2022 04:12 AM
    Can anyone help me with the logic of removing certain characters in a name.

    For eg,     the name is abc-def-ghi-jkl-mno

    I want to remove the characters after the 4th "-" and the name should reflect as "abc-def-ghi-jkl"
    #ApptioforAll


  • 2.  RE: Formula Logic

    Posted Tue August 02, 2022 07:47 AM
    Edited by Guillermo Cuadrado Tue November 05, 2024 06:06 PM

    The method I'm going to suggest is not 100% bulletproof , but you may want to give it a shot:

    /* The formulas assume that you have your data in Long Name */

    1. Short Name =Split(Long Name,5,"-")                                    /* This takes the stuff after the 4th hyphen */

    2. Lookup Helper = Search("-"&Short Name,Long Name)     /* This finds where the extra stuff is.
      BEWARE: it could find things BEFORE the 5th. The actual formula might depend on your data, of course */

    3. Shortened Name = Left(Long Name,Lookup Helper)  /* This chops off the rest */

    I hope this helps, @Rohit Gautham J.​

    ------------------------------
    Regards, Guillermo
    ------------------------------



  • 3.  RE: Formula Logic

    Posted Tue August 02, 2022 08:49 AM
    Thanks!!! Let me try this logic and see, if it works!!