Skip to main content

Hi,

 

I want to split the following colums in Tableau prep before the third occurrence of "/".

 

This is an example:

Right now my colom value looks like this:

https://www.cisco.com/msgs/cco_expired_content.html

 

But I only want:

https://www.cisco.com

 

Does someone has a formula for this?

 

Kind regards

6 answers
  1. May 5, 2019, 3:19 PM

    Hello Eveline,

    Try the following

     

    TRIM( SPLIT( [String], "/", 3 ) )

     

    If this answers your question please mark it as correct so that others may find it in their search for a solution in the future.  Best, Don

    Hello Eveline,Try the following TRIM( SPLIT( [String],

    Edited: I just realized you also want the preceding the website.  In that case.  Simply click the ellipses for the URL and select Split then Automatic.  Prep will split off all the values based on the '/' forward slash automatically.

    Screen+Shot+2019-05-05+at+8.25.27+AM.png

     

    Thereafter create the following calculation and call it simply URL:

     

    [String - Split 1]+'://'+[String - Split 2]

     

    You can remove all of the other splits thereafter without any issue.  Attached is the .tfl file.

0/9000