Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

General Discussions

Discuss any topics that are not product-specific here.

Trim First n characters of a string using in db formula

Pssw0rd
5 - Atom

Hi Team,

 

I am unable to get an output where I want to get all the characters post "-" from a string field using the in db formula tool.

 

Input: 00165 - Basic Service fees

Output: Basic Service fees

 

Any help would be appreciated,

 

Thanks,

1 REPLY 1
DataNath
17 - Castor
17 - Castor

Hey @Pssw0rd, what database are you using? The In-DB tools require you to use the correct SQL syntax for the platform you're connecting to. Here's a couple of some methods that would work using, a - Oracle:

 

 

SELECT
SUBSTR(<FieldName>,INSTR(<FieldName>,'- ')+2)
FROM <TableName>

 

 

b - Snowflake:

 

 

SELECT
REGEXP_SUBSTR(<FieldName>,' - (.*)',1,1,'e')
FROM <TableName>

 

 

Hope this helps!

Labels
Top Solution Authors