Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7644033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:35:24+00:00 2026-05-31T09:35:24+00:00

CASE WHEN CHARINDEX(‘%’, ‘{FixedARMRateReductionLimit}’) > 0 THEN CAST(SUBSTRING(‘{FixedARMRateReductionLimit}’, 0, CHARINDEX(‘%’, ‘{FixedARMRateReductionLimit}’)) as decimal)/100 WHEN

  • 0
CASE 
        WHEN CHARINDEX('%', '{FixedARMRateReductionLimit}') > 0 THEN
            CAST(SUBSTRING('{FixedARMRateReductionLimit}', 0, 
               CHARINDEX('%', '{FixedARMRateReductionLimit}')) as decimal)/100
        WHEN '{FixedARMRateReductionLimit}' = 'Weekly PMMS Rate' THEN
            PARAM_VAL_TXT
        ELSE
            .02
    END
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T09:35:25+00:00Added an answer on May 31, 2026 at 9:35 am

    The moral of the following story is that just because you can do something in SSIS, it’s not always a good idea.

    Case in point, this query. It would be far more efficient to use the existing sql logic to generate the final value than using derived columns or a script task in SSIS (not to mention the waste of pipeline memory, CPU, etc)

    Source query

    I used the following as a source query.

    SELECT '50%' AS FixedARMRateReductionLimit, .1 AS PARAM_VAL_TXT
    UNION ALL  SELECT 'Weekly PMMS Rate' AS FixedARMRateReductionLimit, .3 AS PARAM_VAL_TXT
    UNION ALL  SELECT 'Frack',  .5
    

    Find Percent Position

    Determine whether a percentage symbol exists in the column. This creates an column called PercentPosition

    FINDSTRING(FixedARMRateReductionLimit, "%",1)
    

    Check for rate text

    It should be sufficient to do a simple comparison as the first expression shows but I was having issues with it. I assume it’s a string conversion/comparison issue (see first Note). Rather than diddle with getting a boolean value, I used findstring to generate the ordinal position.

    FixedARMRateReductionLimit == "'Weekly PMMS Rate"
    FINDSTRING(FixedARMRateReductionLimit,"Weekly PMMS Rate",1)
    

    Derive Output

    Enjoy the double usage of the Ternary operator.

    (RateTextPosition > 0) ? (PARAM_VAL_TXT) : (PercentPosition == 0) ? .2 : ((DT_NUMERIC, 18,2) SUBSTRING(FixedARMRateReductionLimit,1,PercentPosition - 1))/100
    

    You could have simplified some of this in a script task but I’d just do the logic in the source.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

CASE WHEN P.NURSING_UNIT is not null THEN P.NURSING_UNIT ELSE '' END NURSING_UNIT ,CASE WHEN
CASE WHEN table1.text IS NULL THEN table2.numbers ELSE table1.text END AS newcolumn When running
I have the following query: Select Name, case when charindex('I',a.S_Data) > 0 then 1
CASE WHEN VPN_Access__c = True THEN 'Need to Setup' + VPN_Access__c ELSE '' END
case i of 0..99 : Function-call('bobo') ; 100..209 : function-smell('Hobo'); 210..300 : function-yikes('argh'); end;
CASE WHEN system_type__c IS NOT NULL THEN 'Please setup a new system [' +
SELECT DISTINCT f.FoodNumber, f.FoodID, fn.Name AS FoodName, d.[Description], substring(n.Note, CHARINDEX(']', n.Note) + 2, LEN(n.Note))
... case 1: string x = SomeString; ... break; case 2: x = SomeOtherString;
Case in point : I've got a handle to a window (for instance, using
Case One: new Date(Date.parse(Jul 8, 2005)); Output: Fri Jul 08 2005 00:00:00 GMT-0700 (PST)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.