Alteryx Designer Desktop Discussions

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

Converting Data Type

Mhnd
8 - Asteroid

Hi everyone,

how can i convert those fields to integers then sum those numbers in this exact field?

Thanks

7 REPLIES 7
atcodedog05
22 - Nova
22 - Nova

Hi @Mhnd 

 

Here is how you can do it. Using Multi-Field formula tool to apply on multiple column and using Regex to capture the numbers.

Workflow:

atcodedog05_0-1641297623202.png

 

Hope this helps : )

 

AZuc
Alteryx
Alteryx

Hi @Mhnd  and @atcodedog05 ,

 

As I'm not really skilled in Regex, I've tried a different approach by parsing the data using Text to Columns twice. First to create new rows then to split the number. After that you can summarize the way you want.

AZuc_0-1641300603783.png

 

 

 

 

André Zuccatti

Sales Engineer - LATAM -
Alteryx, Inc.


atcodedog05
22 - Nova
22 - Nova

Hi @Mhnd 

 

My Approach 2 just in case the Latin (n) Asian (n) black (n) white (n) changes if it doesn't change Approach 1 is the best.

 

Workflow:

atcodedog05_0-1641301621507.png

 

Hope this helps : )

 

binuacs
20 - Arcturus

@Mhnd another method using RegEx Tokenize method

 

binuacs_0-1641314122088.png

 

Mhnd
8 - Asteroid

could you explain approach 2? please 

thanks

atcodedog05
22 - Nova
22 - Nova

Hi @Mhnd 

 

In approach 2

 

atcodedog05_0-1641301621507.png

 

1. In Transpose tool I am converting all (LA & NY) columns to rows 

2. In 1st Regex tool I am splitting Latin (5) Asian (4) black (2) white (7) to each line. This way even if you have Latin (5) Asian (4) black (2) white (7) others (1) it will be split to each line

3. In 2nd Regex tool I am extracting number between brackets

4. In crosstab tool I am getting back into LA & NY columns by summing up value for each Type of Accidents

 

Hope this helps : )

 

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @Mhnd 

Cheers and have a nice day!

Labels