Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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
its not working
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.
Can you share some sample data here with few rows? Your expected output?
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
Hi,
options:
IF(FieldX ='', 0, FieldX) AS FieldXNew
IF(FieldX =null(), 0, FieldX) AS FieldXNew
IF(isnull(FieldX), 0, FieldX) AS FieldXNew
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
X and y are in different tables ,are joined wth left join
Provide some sample data