Alteryx Designer Desktop Discussions

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

Formula Tool - "GetWord" Not Working

lisamccullough
8 - Asteroid

Hello!

I'm using the following formula in the Formula Tool:

 

if GetWord([worksheet],1) = "LEE"
then "LEE"
else "Null"
endif
+ " " +
GetWord([worksheet],0)
+ " " +
datetimeformat(DateTimeNow(),"%B%Y")

 

I have 5 reports feeding into one output report. Where I created a new column header (Worksheet) for each:

LEE Bold

LEE Gold

LEE Yellow

LEE Brown

LEE Black

 

When I run the workflow I get the following "Null CRE October 2020". It doesn't appear to be pulling the formula that's created for each named Worksheet. Can you help me with this?

5 REPLIES 5
mceleavey
17 - Castor
17 - Castor

Hi @lisamccullough ,

 

Without an example dataset it's difficult, but I notice in the first instance of the GetWord function you're looking for the second word, is that what you mean to do?

If you could provide some data we can have a look.

 

M.



Bulien

Qiu
20 - Arcturus
20 - Arcturus

@lisamccullough 

 


GetWord(string, n): Returns the Nth (0-based) word in the string. Words are defined as a collection of characters separated by a space. 0-based index, means the first word is at the 0 position.


Maybe you want to start with 0 when using Getword.

grazitti_sapna
17 - Castor

@lisamccullough , give this a try.

grazitti_sapna_0-1603778994657.png

 

As suggested by @Qiu  and getword function always start with 0 to n numbers. In your formula you have used GetWord([Field1],1)="LEE" at LEE's index is 0 here.

 

Thanks

Sapna Gupta
Qiu
20 - Arcturus
20 - Arcturus

@lisamccullough 
Appreciate if you could mark it as accepted if you solved the issue based on comments from me and @grazitti_sapna 😁.

Qiu
20 - Arcturus
20 - Arcturus

@lisamccullough 
Thank you for the mark!

Labels