Alteryx Designer Desktop Discussions

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

Imputing null string values with the mode

Saif_Allan
6 - Meteoroid

Am trying to impute string that has null values as a feature engineering to get rid of the null values with the most common value in the string ( mode) , how can i do this ? tried to do lookup table or use macros, can't get my head around it, any help ?

11 REPLIES 11
atcodedog05
22 - Nova
22 - Nova

Hi @Saif_Allan 

 

Did you try using this option

atcodedog05_0-1641473989937.png

 

Hope this helps : )

 

Saif_Allan
6 - Meteoroid

Imputing tool is only for numerical data type, I am trying to do it on strings, any other solution? thanks anyway.

atcodedog05
22 - Nova
22 - Nova

Hi @Saif_Allan 

 

Can you tell us which you want to impute on ?

Saif_Allan
6 - Meteoroid

I want to impute all of the strings type that has null values in them, with the mode of the field - the mode of the field is the most reparative value in the field- so i want to impute all of my string fields that has null values in them. you can check their names in the lookup table - i think 38 records from 81-.

atcodedog05
22 - Nova
22 - Nova

Hi @Saif_Allan 

 

Here is how you can do it.

Workflow:

atcodedog05_0-1641474443219.png

 

Hope this helps : )

 

Saif_Allan
6 - Meteoroid

I will try this out, Thank you so much!!!!

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @Saif_Allan 

If my response helps please don't forget to mark it as solution.

Cheers and have a nice day!

Saif_Allan
6 - Meteoroid

How can I apply the method you gave me to my 38 fields ? is there a practical way to do this ?

atcodedog05
22 - Nova
22 - Nova

Hi @Saif_Allan 

 

You can achieve it using python code in python tool of Alteryx. This code imputing all columns with code

 

Workflow:

atcodedog05_0-1641477479456.png

 

Hope this helps : )

 

Labels