We have extended our Early Bird Tickets for Inspire 2023! Discounted pricing goes until February 24th. Save your spot!

Alteryx Designer Discussions

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

How to eliminate a specific word if it is at the beginning of a sentence

rdas040
5 - Atom

In my daily report there is a column "Notes". I want to eliminate all those line items where the comments in the "Notes" starts with "Open Issue". I am new to Alteryx with very limited knowland would really appreciate if anyone can assist me on this. 

7 REPLIES 7
IraWatt
17 - Castor

Hey @rdas040,

One way to do this is with the formula tool and a formula like this:

IF StartsWith([Field1], "Open Issue") THEN Substring([Field1],11,Length([Field1])) ELSE [Field1] ENDIF

The formula checks if it starts with Open Issue (case insensitive) if it does then it removes the first 11 characters ("open issue ") else it does not change the text.

IraWatt_0-1662466712809.png

The community has some quick and easy videos on formulas and the Formula Tool here https://community.alteryx.com/t5/Interactive-Lessons/tkb-p/interactive-lessons/label-name/Writing%20...

 

Any questions or issues please ask

Ira Watt
Technical Consultant
Watt@Bulien.com 

 

ChrisTX
14 - Magnetar

Try a Filter tool, with coding like:

  IF StartsWith([Notes],"Open Issue")  then 0

  else 1

  ENDIF

 

The 0 represents a Boolean value for False and will send records through the filter tool F output anchor.

 

Suggestions for beginners:

  use the top menu for Learn > Academy > Learning Paths, and Interactive Lessons

 

List of all functions: https://help.alteryx.com/20221/designer/functions

 

Chris

DataNath
16 - Nebula

Hey @rdas040, one of the String functions built into Alteryx is Startswith(), which does exactly what it says on the tin and looks at the start of the string for whatever target you provide (in your case, "Open Issue"). For your use, you can therefore use this function within a filter with the following expression:

 

!StartsWith([Notes], 'Open Issue')

 

In Alteryx, we use the exclamation mark to indicate 'NOT' and therefore what this expression is saying is: [Notes] does not start with 'Open Issue'.

 

Now when this is checked, it's either true - doesn't start with 'Open Issue', or false - does start with 'Open Issue'. Therefore, you are only interested in what comes out of the top (True) anchor of the Filter tool, as shown below.

 

Before:

DataNath_0-1662466862714.png

 

After:

DataNath_1-1662467006458.png

 

Please let us know if you need any further clarification or if this doesn't answer your request!

grazitti_sapna
17 - Castor

@rdas040 , you can accomplish what you need by using filter tool, just add filter tool after your input and check the custom filter radio button and add below condition in it, all the Notes that begins with "open issues will be moved to False output. Pleas take care of the case of the string.

 

!startsWith([Notes,"Open Issue")

Sapna Gupta
Alteryx_AR
12 - Quasar

Hey @rdas040   You can use following expression in filter tool to accomplish the task. 

 

Alteryx_AR_1-1662468639659.png

 

Hope this helps :)

Emmanuel_G
13 - Pulsar

Hi @rdas040 ,

 

Find attached another way to do this with left function ( same reasoning as in excel ).

Emmanuel_G_0-1662479856747.png

 

rdas040
5 - Atom

It worked like I wanted. thanks for your assistance.

Labels