3 Replies Latest reply on Apr 7, 2017 1:32 AM by SANDIP SHARMA

    Extract all the text before the last name/space

    Sumeet Bedekar

      Hi Tableau Lovers,

       

      Hope you all are doing well.

       

      I am looking for Extract all the text before the last name/space.

       

      For Example :-

       

      [Input] ALCN CLR CR 12 FL OZ W/LNS CS 004711360912 -------------> ALCN CLR CR 12 FL OZ W/LRNS CS [Output]

       

      (Here i wanted to get the Text before last name/Space)

       

      Note: Length of Text is not constant. Only Pattern I believe here is the Space before last Text i.e number 004711360912

       

      I tried Tableau Custom Split, but was not able to get the desired result.

       

      My Approach :-

      In excel we can get the desired result using this formula.

      =LEFT(C6,FIND("‡",SUBSTITUTE(C6," ","‡",LEN(C6)-LEN(SUBSTITUTE(C6," ",""))))-1)

      Where C6= Text (ALCN CLR CR 12 FL OZ W/LNS CS 004711360912 )

       

      *** But I dont want to go Excel Formula approach...

       

      I am looking for the way to do it in Tableau. (I guess Reg Exp will help me in this)

       

      Thanks in advance.

       

      Regards,
      Sumeet

       

      Pinging Mahfooj Khan & Jonathan Drummey. It will great to know your thought on this.