SSIS sum of column

Posted on 2011-10-24
Last Modified: 2013-11-18
This should be fairly easy for you SSIS pros.. I'm kind of new to it.. I have a OLE DB Source Editor that runs the code below and puts the result into a table in SQL(another OLD DB Source).. The only thing I have inbetween the two OLE DB Source editors now is a data conversion transformation editor..... I need to add something else in between that checks the sum of all [current_onhand] and if 0 then fail the package.. If sum [current_onhand] <1 then.... I would like to avoid the VB script task thing because I'm not a VB person if at all possible.. I'm using visual studio 2008.. Is there a componite to check the sum of a colum and then fail if certain condition is met? I want to stick this in between the 2 OLE DB Sources..
SELECT item_id, item, current_onhand, next_supply, next_supply_date, col1,
       col2, col3, col4, col5, creation_date, created_by
FROM sfa.z_item_supply

Open in new window

Question by:cheryl9063
    LVL 26

    Expert Comment

    LVL 1

    Author Comment

    I need help with this.. Not just a link to other sites for me to read.. I put this in the conditional split and I'm getting the error the function sum is not recognized when I try to click the configure error output.

    see attached screen print

    LVL 11

    Accepted Solution


      The condition Split transformation will not support the "Sum" function name .
      it will do the row by row  value split ups.

    for your case you can use Aggregate  tranformation before the Conditional split , then based on the output data  from Aggregate tranformation you can split your data ....

    Note :

    based on the above code

    sum([CURRENT_ONHAND])<1-- this will not work
    ([CURRENT_ONHAND])<1-- this will work

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    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…
    Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
    Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
    The viewer will learn how to dynamically set the form action using jQuery.

    779 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

    15 Experts available now in Live!

    Get 1:1 Help Now