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 ««12

Derived Column to handled mulitple conditions in CASE statement? Expand / Collapse
Author
Message
Posted Tuesday, May 28, 2013 10:20 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 9:39 AM
Points: 5,167, Visits: 12,017
KoldCoffee (5/28/2013)
Phil, I don't get what you're saying. How would a Lookup table help me in a situation where I need to derive new values in the source table based on existing values (also in the source table)? Have you done this? If so, please provide some example.
I have successfully implemented lookups for retrieving additional columns from referenced dataset columns (for eg. to handle joins) but what I need in the above scenario is the syntax to handle for a case statement.
The syntax Vikash gave me works....except that it needs to evaluate 0 without quotes.


I'm sorry about that - my response was aimed at your first post, not the subsequent one, which I had assumed was a similar question, without reading it closely enough. You are correct, my idea cannot be applied in this case, though it would work for your first post.



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 #1457575
Posted Tuesday, May 28, 2013 11:38 PM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Yesterday @ 9:00 PM
Points: 680, Visits: 1,598
Phil, you've always been spot on for me in the past, so I was and and . and a little bit wondering if it had more to do with other post too, after I about half a day of it teasing the outer fringes of my brain

Both problems solved. Lookups turns out to bring forward all the inputs plus the referenced columns and thank goodness for all the help and materials on line and here.
Post #1457584
Posted Tuesday, May 28, 2013 11:50 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 9:39 AM
Points: 5,167, Visits: 12,017
KoldCoffee (5/28/2013)
Phil, you've always been spot on for me in the past, so I was and and . and a little bit wondering if it had more to do with other post too, after I about half a day of it teasing the outer fringes of my brain

Both problems solved. Lookups turns out to bring forward all the inputs plus the referenced columns and thank goodness for all the help and materials on line and here.


Well done on getting it solved!



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 #1457585
Posted Thursday, May 30, 2013 7:09 PM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Yesterday @ 9:00 PM
Points: 680, Visits: 1,598
Vikash, Phil, somebody?

[Business Unit] is MFMGOOGLE and I want just the 'GOOGLE' part.

This parses in the Derived Column transformation but isn't working as intended:

SUBSTRING([Business Unit],4,LEN([Business Unit]) - 3)


How to fix this expression to return intended result?
Post #1458505
Posted Monday, June 3, 2013 12:01 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Monday, June 9, 2014 6:15 AM
Points: 79, Visits: 243
You can use following:

RIGHT([Business Unit],6)


Vikash Kumar Singh || www.singhvikash.in
Post #1459418
Posted Monday, June 3, 2013 10:06 PM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Yesterday @ 9:00 PM
Points: 680, Visits: 1,598
Vikash, could you kindly help me with this string here http://www.sqlservercentral.com/Forums/Topic1458631-364-2.aspx#bm1459386

I can't help myself and no one else can either, so far. I think you will know answer.
Post #1459526
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse