Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

mapping load for checkng null values

i have a field(x) which has some null values against (y)

so i want to do a mapping load where i need to check the 0 values

so wherever is 0 it shud consider it as null so the value displayed in field y shud be correct

how to do that.

9 Replies
prieper
Master II
Master II

Why do you want to make a mapping?
would do right away in the script:

...

IF(LEN(TRIM(x)) OR x=0, NULL(), y)              AS y_corrected

...

HTH Peter

Anonymous
Not applicable
Author

its not working

juan_patrick
Creator
Creator

You can put 0 to null values:

if(isnull(x), 0, x) as field_x,

After that you know that all zero values are the same.

vishsaggi
Champion III
Champion III

Can you share some sample data here with few rows? Your expected output?

effinty2112
Master
Master

Dear Dynamic Girl,

Do you mean if x is null then treat as if it is zero?

try Alt(x,0) either in script or in a chart expression.

Alt(x,0) will return x if it is numeric and will return 0 if non-numeric (including null).

Kind regards

Andrew

el_aprendiz111
Specialist
Specialist

Hi,

options:

IF(FieldX ='',  0,    FieldX) AS FieldXNew


IF(FieldX =null(), 0, FieldX) AS  FieldXNew


IF(isnull(FieldX), 0, FieldX) AS  FieldXNew

Anonymous
Not applicable
Author

X and y are fields in difrnt tables,actly we are showing count(distinct x) and y field has 4 values ,say count(distinct x ) is Shwng 40 value but if I select all the 4 values in y field so the count is around 35 so there is a difrnce in values ,we are assuming there is some 0 values against this,so wat I want to try replace all 0 with nulls only

Anonymous
Not applicable
Author

X and y are in different tables ,are joined wth left join

passionate
Specialist
Specialist

Provide some sample data