SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


dervied box


dervied box

Author
Message
ronan.healy
ronan.healy
Old Hand
Old Hand (384 reputation)Old Hand (384 reputation)Old Hand (384 reputation)Old Hand (384 reputation)Old Hand (384 reputation)Old Hand (384 reputation)Old Hand (384 reputation)Old Hand (384 reputation)

Group: General Forum Members
Points: 384 Visits: 232
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?
Lempster
Lempster
SSCarpal Tunnel
SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)

Group: General Forum Members
Points: 4999 Visits: 1657
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
ronan.healy
ronan.healy
Old Hand
Old Hand (384 reputation)Old Hand (384 reputation)Old Hand (384 reputation)Old Hand (384 reputation)Old Hand (384 reputation)Old Hand (384 reputation)Old Hand (384 reputation)Old Hand (384 reputation)

Group: General Forum Members
Points: 384 Visits: 232
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
Lempster
Lempster
SSCarpal Tunnel
SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)SSCarpal Tunnel (5K reputation)

Group: General Forum Members
Points: 4999 Visits: 1657
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
ronan.healy
ronan.healy
Old Hand
Old Hand (384 reputation)Old Hand (384 reputation)Old Hand (384 reputation)Old Hand (384 reputation)Old Hand (384 reputation)Old Hand (384 reputation)Old Hand (384 reputation)Old Hand (384 reputation)

Group: General Forum Members
Points: 384 Visits: 232
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?
Phil Parkin
Phil Parkin
SSC-Forever
SSC-Forever (49K reputation)SSC-Forever (49K reputation)SSC-Forever (49K reputation)SSC-Forever (49K reputation)SSC-Forever (49K reputation)SSC-Forever (49K reputation)SSC-Forever (49K reputation)SSC-Forever (49K reputation)

Group: General Forum Members
Points: 49927 Visits: 21151
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.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
herladygeekedness
herladygeekedness
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1306 Visits: 813
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search