Solved

SSIS Conditional Split

Posted on 2009-04-10
2
799 Views
Last Modified: 2013-11-10
Hi Everyone,

I have the need to implement something similar to a case statement in an SSIS package.

The scenario is this:

I have the following:

Conditional Split  --> Dervired Column --> Summarize Transform

After the Derived Column Transform has been executed there are a variety of new columns that are created. One of the is Qty.

What I need to do is change the Qty value to 0 of Products that have a certain product code and then pass the changed data back to the Summarize Transform as well as all the other data that didn't need to be changed.

What is the best course of action to accomplish this? Another Conditional Split and a Derived Column Transform....tried this and ofcourse I can't have multiple input paths to a Summarize Transform.

Not sure how to go about this. Help please!

Thanks

JF
0
Comment
Question by:smacky75
2 Comments
 
LVL 11

Accepted Solution

by:
aaronakin earned 500 total points
ID: 24121918
Is the Qty column being created in the Derived Column component?  If so, what condition do you have to create the column?

You can generally use the shorthand (? :) for IF ELSE to create the column.  For instance, in your condition,

ProductCode == "XXXX" ? 0 : ProductQty

You would need to substitute XXXX for your product code, and substitute the ProductQty column as your actual column or the existing condition.  If you're using a condition to determine the Qty already, you can use this instead...

ProductCode == "XXXX" ? 0 : (your condition)
0
 

Author Closing Comment

by:smacky75
ID: 31568909
Thanks...worked well.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL that will turn the rows in to columnsin date format 28 52
SQL Consolidate rows 3 24
Need sql in string 2 28
Converting Stored Procedure to SQL Statement 5 36
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

685 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