5 Replies Latest reply on May 13, 2017 8:07 PM by Shahroz Ahmed

# how to give null value a zero ? ( Zn function)

Hi Guys,

Please explain ZN Function in tableau with sample

thanks

Shahroz

• ###### 1. Re: how to give null value a zero ? ( Zn function)

Hi,Shahroz

ZN(expression)

this equals to

if expression = Null then

0

else

expression

end

ZZ

1 of 1 people found this helpful
• ###### 2. Re: how to give null value a zero ? ( Zn function)

Data Source

I want to add Profit on Product A and Product B , but Value+Null=Null

Net profit coming as Null as above

Hence we need ZN function as below (which will convert Null to 0)

Now we can see the correct Net Profit for New York.

Hope it helps.

Ritesh

5 of 5 people found this helpful
• ###### 3. Re: how to give null value a zero ? ( Zn function)

method 1 )Use Zn(profit on product A) + zn( profit on product B)

Or

IFF( Isnull(profit on product A) , 0 , profit on product A ) + IFF( Isnull(profit on product B) , 0 , profit on product B)

• ###### 4. Re: how to give null value a zero ? ( Zn function)

Thanks Zhouyi

• ###### 5. Re: how to give null value a zero ? ( Zn function)

Thanks Ranganna.