Solved

use of nested statment (CASE or if...else...) in derive column transfromation in SSIS

Posted on 2011-09-20
5
436 Views
Last Modified: 2012-05-12
Hi,

I need to add large case statemnt in a derive column  tranformation in SSIS. The query is similar to below however I need to nested more than the sample below. The simple query like below is throwing an error., i'm not sure what wrong with that syntax. I would appreciate if I can get samples nested query for SSIS derive column transformation.

ISNULL(amt) ? "1":Amt && iif(Amt)=="$0.01 > $1,000" ? "2":Amt

Thanks
0
Comment
Question by:keplan
  • 3
5 Comments
 
LVL 9

Expert Comment

by:sachinpatil10d
ID: 36571874
Try this

case when isnull(Amt,1) then
      case Amt when 0.01 > 1,000 then 2
      else Amt end
else Amt end
0
 

Author Comment

by:keplan
ID: 36571929
Please note: i need in use in derive column transformation in SSIS, you sample is for t-sql
0
 
LVL 21

Accepted Solution

by:
Alpesh Patel earned 250 total points
ID: 36573194
You cannot use Case or If need to use Ternary operator

Condition ? True : False
0
 

Author Comment

by:keplan
ID: 36577298
thanks for that, sorry i am not familiar with Ternary operator, kindly post some samples if possible, and also ca ternary operator be nested?
0
 

Author Closing Comment

by:keplan
ID: 36945713
helpful
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now