Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
SolvedPrivate

Using Derived Column Transformation Editor to populate 0 if the incoming value is null

Posted on 2014-09-12
4
Medium Priority
?
33 Views
Last Modified: 2016-02-13
i have the expression. I know this is a form for text type fields. i have a numeric field. IS this not the right syntax ?

ISNULL([_per_aban]) 0: [_per_aban]
0
Comment
Question by:Auerelio Vasquez
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 49

Assisted Solution

by:PortletPaul
PortletPaul earned 1000 total points
ID: 40319608
ISNULL ( check_expression , replacement_value )

ISNULL( [_per_aban] , 0 )

see: http://msdn.microsoft.com/en-us/library/ms184325.aspx

{+edit} That's for TSQL
are you asking for SSIS?
0
 
LVL 1

Author Comment

by:Auerelio Vasquez
ID: 40319716
yes, i'm talking about SSIS. the transformation editor
0
 
LVL 1

Author Comment

by:Auerelio Vasquez
ID: 40319825
wha't i'm trying to do, is read a .csv file. If the value is null, just replace with 0.

the incoming value is null, which causes problems getting into a numeric column (even though i allow nulls). I'm using this without error:

ISNULL(SL) ? 0 : (DT_NUMERIC,18,0)SL --On the fly conversion from string to numeric

however, when I run the package, i get the below error

[Derived Column [2719]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "component "Derived Column" (2719)" failed because error code 0xC0049063 occurred, and the error row disposition on "output column "_SL" (2791)" specifies failure on error. An error occurred on the specified object of the specified component.  There may be error messages posted before this with more information about the failure.
0
 
LVL 21

Accepted Solution

by:
Alpesh Patel earned 1000 total points
ID: 40336383
In Derived column

Create nwe Column and write expression.


 (DT_NUMERIC,18,0)(ISNULL([IncomingColumn]) ? 0 : [IncomingColumn])
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question