Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

dervied box Expand / Collapse
Author
Message
Posted Monday, June 16, 2014 8:06 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: 2 days ago @ 4:33 AM
Points: 115, Visits: 185
i need to do the following
If Fund Complex = “Russell” and INV_SECTYPE_COD equal to ’75’

iii. NotionalAmount = [(SHARS/MULTIPLIER) * (MKT_PRC_BASE) *

(MULTIPLIER/100)]-[UNREALIZED_APP_DEP_BASE]

can this be done in a dervied box or whats the best way to it. its in a datflow part. any ideas?
Post #1581140
Posted Monday, June 16, 2014 8:53 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Friday, August 22, 2014 4:18 AM
Points: 2,048, Visits: 1,403
Do you want to create a derived column based on other columns or do you want to direct data down different paths depending on column/derived column values? If the former then, yes, use a derived column. If the latter then you can use a Conditional Split transform or Precedence Constraints that use both a Condition and an Expression.

Regards
Lempster
Post #1581169
Posted Monday, June 16, 2014 8:57 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: 2 days ago @ 4:33 AM
Points: 115, Visits: 185
well the whole logic is this
Change the calculation of the Notional Amount for Future securities for all funds

a) If INV_SECTYPE_COD equal to ’70’, ‘71’, ‘72’, ‘73’, ‘74’, or ‘75’

i. NotionalAmount with (NO_CONTRACTS / MULTIPLIER)
b) If Fund Complex = “Russell” and INV_SECTYPE_COD equal to ’70’, ‘71’, ‘72’, ‘73’, ‘74’

ii. NotionalAmount with [(SHARS/MULTIPLIER) * (MKT_PRC_BASE) *

(MULTIPLIER)]-[UNREALIZED_APP_DEP_BASE]
c) If Fund Complex = “Russell” and INV_SECTYPE_COD equal to ’75’

iii. NotionalAmount from with [(SHARS/MULTIPLIER) * (MKT_PRC_BASE) *

(MULTIPLIER/100)]-[UNREALIZED_APP_DEP_BASE]


and im not sure the best way to do it. i was trying drvied columns but couldnt get the forumal to work kept going red so wasnt sure if i was doing it right or if it would let me.

i was going to use a replace and do the code then aws this will more than likely update after the orginal vales are in table id say. might be better to use a query
Post #1581184
Posted Monday, June 16, 2014 9:08 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Friday, August 22, 2014 4:18 AM
Points: 2,048, Visits: 1,403
Okay, not sure that I understand fully, but I always try and do as much as possible in my Source query so assuming that you are specifying a SQL query in your OLEDB Source (rather than selecting an entire table), you could maybe use CASE statements to set your column(s) appropriately. That may be what you mean at the very end of your previous post when you state 'better to do it in a query'.

Regards
Lempster
Post #1581201
Posted Monday, June 16, 2014 9:13 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: 2 days ago @ 4:33 AM
Points: 115, Visits: 185
well i way trying to use a dervied column
this was the code i was trying
(TRIM(INV_SECTYPE_COD) == "75") && (TRIM(AttributeNames) == "")?[(SHARS/MULTIPLIER) * (MKT_PRC_BASE) *(MULTIPLIER/100)]-[UNREALIZED_APP_DEP_BASE]: Notional AMount
but there is errors in it. is it possible to do it this way?
Post #1581207
Posted Tuesday, June 17, 2014 12:30 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 2:06 PM
Points: 5,047, Visits: 11,797
ronan.healy (6/16/2014)
well i way trying to use a dervied column


Please note: the column is 'derived', not 'dervied'



Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.
Post #1582050
Posted Monday, June 23, 2014 2:48 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, June 27, 2014 2:05 PM
Points: 300, Visits: 810
Yes, you can do it in derived column. what you need is a bit more cumbersome than what I would want to do in a dc, but if you can't do it in source query and don't have a script component onboard already, use derived column.

I stumble around with the syntax in them, so I suggest you build one little case at a time to get their syntax correct then join them up with the appropriate ands/ors.

Do keep in mind that you are confined to the functions and operators that display top right in the component.
Post #1585322
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse