none
How to convert field value to field name in data flow RRS feed

  • Question

  • I have a Data Flow that performs a calculation on two fields:  TargetValue * FixedOpsEECount.  Now, my requirements have changed and I must calculate on one of 3 distinct EECounts: TargetValue * FixedOpsEECount, TargetValue * FrontEndEECount or TargetValue * TotalEECount.  I added a field to my Data Flow called TargetMeasure.  TargetMeasure contains one of the 3 EECounts:  i.e. "FixedOpsEECount", "FrontEndEECoun"t or "TotalEECount".  How can I tell SSIS to convert the TargetMeasure value(text) to the field name for a calculation.  See Graphic.  Appreciate any suggestions.


    Mario

    Tuesday, April 2, 2013 7:23 PM

Answers

  • [TargetMeasure]=="FixedOpsEECount" ?[FixedOpsEECount]:

    ([TargetMeasure]=="FrontEndEECount" ?[FrontEndEECount]:[TotalEECount])



    Russel Loski, MCT, MCSA SQL Server 2012, 2008, MCITP Business Intelligence Developer and Database Developer 2008 Twitter: @sqlmovers; blog: www.sqlmovers.com

    • Marked as answer by Mario5280 Tuesday, April 2, 2013 8:00 PM
    Tuesday, April 2, 2013 7:44 PM
  • In Derived column you need to compare the value of field TargetMeasure with the three counts and then perform the calculation.

    Ex: [TargetMeasure]=="FixedOpsEECount" ? TargetValue*FixedOpsEECount : ([TargetMeasure]=="FrontEndEECoun" ? TargetValue*FrontEndEECoun:TargetValue*TotalEECount)


    Nitesh Rai- Please mark the post as answered if it answers your question

    • Marked as answer by Mario5280 Tuesday, April 2, 2013 8:02 PM
    Tuesday, April 2, 2013 7:48 PM

All replies

  • [TargetMeasure]=="FixedOpsEECount" ?[FixedOpsEECount]:

    ([TargetMeasure]=="FrontEndEECount" ?[FrontEndEECount]:[TotalEECount])



    Russel Loski, MCT, MCSA SQL Server 2012, 2008, MCITP Business Intelligence Developer and Database Developer 2008 Twitter: @sqlmovers; blog: www.sqlmovers.com

    • Marked as answer by Mario5280 Tuesday, April 2, 2013 8:00 PM
    Tuesday, April 2, 2013 7:44 PM
  • In Derived column you need to compare the value of field TargetMeasure with the three counts and then perform the calculation.

    Ex: [TargetMeasure]=="FixedOpsEECount" ? TargetValue*FixedOpsEECount : ([TargetMeasure]=="FrontEndEECoun" ? TargetValue*FrontEndEECoun:TargetValue*TotalEECount)


    Nitesh Rai- Please mark the post as answered if it answers your question

    • Marked as answer by Mario5280 Tuesday, April 2, 2013 8:02 PM
    Tuesday, April 2, 2013 7:48 PM
  • That works.  Awesome, Russ and Nitesh.  Thanks!

    Mario


    • Edited by Mario5280 Tuesday, April 2, 2013 8:03 PM
    Tuesday, April 2, 2013 8:01 PM