Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop 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
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
15 - Aurora

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
17 - Castor

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