Eval Math expressions using SSIS

  • HI,

    I am very new SSIS.I want make use of "System.Text.RegularExpressions" in my SSIS package.

    My Requirement is as below

    As per my project requiremnet there is a need to store formula(Math Expressions) details in the database.I will help my

    you to understand my requirement using an example.

    There are two table in sqlserver database.

    1)ItemTable:Which consists of raw data.

    ItemID itemvalue Date

    a 22 2/9/2008

    b 26 2/9/2008

    c 55 2/9/2008

    d 98 2/9/2008

    e 87 2/9/2008

    a 25 2/10/2008

    b 76 2/10/2008

    c 34 2/10/2008

    d 46 2/10/2008

    e 43 2/10/2008

    Where ITemid+date forms the composite key.

    Requirement is to calcuate some formulas(Math Expressions) based on this raw data.

    The formula details(Math Expressions) are mentioned below FormulaTable.

    2)FormulaTable:Which consits of formula details.

    FormulaID:Its an identity column which holds the ID of the formula.

    Formula:This column contains math expressions.Which should be dynamically caluclated.

    Date:Holds the date

    FormulaID Formula Date

    1 ((b+d)/e)*120 2/9/2008

    2 ((d+e)/e)*150 2 /9/2008

    3 ((b+c)/12*)150 2/9/2008

    1 ((b+d)/13)*100 2/10/2008

    2 ((d+e)/e)*100 2/10/2008

    3 ((b+c)/d*)100 2/10/2008

    Lets calucate the formula(Math Expressions) on the 2/9/2008 whose formuala id is 1.

    using formula id "1" expression will be evaluated as follows

    ((b+d)/e)*120(where b,d and e are the itemid's in the ItemTable).

    The result of the formula should be ((26+98)/87)*120=142.52(where 26,98 and 87 are the corresponding values for that itemid's in the ITemTable).

    Currently I have implemented this logic using ASP.NET by making use "System.Text.RegularExpressions" assembley.

    Now I want to implement the same using SSIS.I mean to say is I want to make use of "System.Text.RegularExpressions"

    in SSIS.

    How to go about it.

    Thanks in advance.

    Regards,

    Sriram Satish

  • One way would be to do the regular expression stuff in a Script Task (or Script Component - depending on how you do it). That will give you access to the regex classes you want.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply