community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
SOLVED

Left Function

Atom

Is there a fucntion or formula that I can use that will mimic the the LEFT function in Excel? I am trying to pull the first 5 charactors from a string ?

 

Thank you in advance!

Alteryx Certified Partner
Alteryx Certified Partner

LEFT([STRING],5)

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Atom

Thank you so much and "DUH" to myself! I did have brackets intially.

Highlighted
Meteor

Mark, what if you had this:

 

"Trying to find the first position of o"

 

In excel, you can search the string and get back that the first "o" is at position 9 (might be 8.  I don't remember if search is 0 based).

I have a situation in Alteryx where I'm trying to find a character "|".  I'd like to do something like  --> right([fieldname],length([FieldName])-search([fieldname],'|'))

Alteryx Partner

Use FINDSTRING the same way as you would in Excel :) 

Meteor

Hi cmcclellan.  FINDSTRING brought back True/FAlse, not the position of the character in the string.  Unless I'm not using it correctly ... a real possibility -:)

Alteryx Certified Partner
Alteryx Certified Partner

@Suzanne,

 

I'm sorry but I'd have to go to a library (inside of a museum) to dust off a book on Excel to answer your question.  I'll answer it in the 21st century with a regular expression.  I still don't know what your objective is and why you wouldn't use a text to columns to parse on the | symbol.  But before I go there, here is a cut & paste from the help on FindString():

 

FindString(String,Target): Searches for the occurrence of a particular string (Target) within another string (String) and returns the numeric position of its occurrence in the string.

Returns the 0 based index of the first occurrence of Target in String. Returns -1 if no occurrence.

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Alteryx Partner

Not true/false, you just have to understand what the results are saying ( @MarqueeCrew already explained), but this might help more :

 

2019-01-17 09_55_40-Alteryx Designer x64 - New Workflow4_.png

 

It's a zero-based calculation, so you might need to add 1 to the result depending on what you want to do ... 

 

0 = John found at the start

1 = John found.  First character is counted as 0, second character is 1

7 = John found, calculation as per above

-1 = John not found at all

 

FINDSTRING IS case-sensitive = JOHN, John and john will give 3 different results

Labels