ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

If startswith([accountnumber], “1”,”2”,”3”) then B else P endif

jmfaizaan
5 - Atom

The formula throws an error saying that the startswith function has very few arguments. Can someone help please?

4 REPLIES 4
Sarreddy
9 - Comet

My solution @jmfaizaan 

 

Sarreddy_0-1667884790365.png

 

flying008
15 - Aurora

Hi, @jmfaizaan 

 

The function StartsWith only have most 3 arguments for calculation, your formula syntax like incorrect.

1st argument:   Field Name or String.

2nd argument: String to find.

3rd argument: Case-insensitive parameter. default is 1.

So you maybe can try this formula:

If StartsWith(ToString([accountNumber]), "1") or StartsWith(ToString([accountNumber]), "2") or StartsWith(ToString([accountNumber]), "3") 
Then '8' Else 'P'
Endif

 

DenisZ
11 - Bolide

Please see an alternative solution

 

DenisZ_0-1667888516345.png

 

Alternatively, you could solve this with RegEX

 

DenisZ_0-1667888876628.png

 

 

 

 

CarliE
Alteryx Alumni (Retired)

@jmfaizaan ,

 

CarliE_0-1667923524519.png

I used an IN statement to have a little bit of a cleaner formula -- if Left([AccountNumber], 1) in ("1","2","3") then '8' else 'P' endif

 

If this helped to solve your problem, please be sure to mark it as a solution so other users on the community can benefit :)

 

Thanks!

Carli
Labels
Top Solution Authors