community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
#SANTALYTICS

The highly anticipated Alteryx Community tradition is back! We hope you'll join us!

Learn More
We will be upgrading the Gallery to our 2019.4 release this Saturday, December 7th beginning at 9:00am MT. We expect the outage to take last approx. 2.5 hours.
SOLVED

In Database replace null with 0

Asteroid

Hi,

 

I have a dataset via in-DB tool which includes null values that i would like to replace with 0. I'll be making calculations on the columns using the formula in-db tool, but it currently doesn't read these null values so the output remains null.

 

I understand we can use the data cleanse tool, but i'll need to data stream out in order to do this and the second part of the workflow involves the calculations so i'm not sure how i'd get the data back in.

 

Does anyone know what is the best way to go about this?

 

 

Thanks

afk

Alteryx Certified Partner
Alteryx Certified Partner

Hi @akasubi 

 

Which database provider are you using?

 

Cheers,

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

@akasubi 

 

If you use Formula In-DB with SQL Server, this will work.

 

ISNULL([Field], 0)

 

If it's Oracle:

NVL([Field], 0)

 

If it's MySQL

IFNULL([Field], 0)

 

Cheers,

Asteroid

Hi @Thableaus 

 

I'm using SQL Server.

 

Will I need to input the formula for all fields affected? The multi-field formula tool is quite handy as I could convert multiple fields at the same time.

 

Thanks

afk

Alteryx Certified Partner
Alteryx Certified Partner

@akasubi 

 

There's no Multi-Field formula In-DB.

 

Are there many fields? Because the function is very short, you can use a single Formula In-DB tool and just paste the field names into the function.


Cheers,

Asteroid

@Thableaus 

 

Yeah, quite a few fields with possibility of more fields added in future. Data cleanse tool also allowed me to retain the column name without having to change it. (i actually meant data cleanse in an earlier response as opposed to multi-field formula).

 

Guess writing the formula would be my only solution for the moment.

 

Will give it a go, thank you!

 

Labels