Start Free Trial

Alteryx Designer Desktop Discussions

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

Alteryx Formula tool

Claudiu159
6 - Meteoroid

hello guys so i have to use the formula tool in order to create a new column that shows me the year of the manufacturing for the cars. The tasks sounds like " Create a new column “manufacturingYear” that shows the year for the products included in
productlines containing the word ‘Cars’. (Hint: look at the beginning of each product name for
the year). What would be the best formula to use/ best approach?

Thank you

7 REPLIES 7
binu_acs
21 - Polaris

@Claudiu159 You can use the Regex_Replace() formula to achieve your result. Can you provide a sample input file and expected output result?

Emmanuel_G
13 - Pulsar

@Claudiu159 

 

I don' know if I understand well but If word "Cars" is always at the beginning of each line, you can use the Trim function to remove it.

 

Trim([Field],"Cars") should remove "Cars" as prefix or suffix.

 

If it's not clear, can you send us an input and the desired output?

Claudiu159
6 - Meteoroid

123.png

I need to make  a new column with manufacturingYear only for the ones containing the word Cars 

Claudiu159
6 - Meteoroid

123.png

 Desired output is to have a new column called manufacturingYear only for the ones that include Cars in their name

binu_acs
21 - Polaris

@Claudiu159 One way of doing this

 

binuacs_0-1663671721685.png

 

Emmanuel_G
13 - Pulsar

@Claudiu159 

 

Find in attachement the way of doing this.

 

Please do not hesitate to accept this answer as solution if it helped.

 

Emmanuel_G_0-1663671761849.png

 

Claudiu159
6 - Meteoroid

Thank you guys! 

Labels
Top Solution Authors