Questions on variables

  • I have been hearing that with the new version that there has been a lot of new components or tasks, which they are, to replace a lot of scripting we use to do. Are there new tasks that I would use to update varibles about the data or rows coming in?

    Before I would have an active script that handled my counters or variable assignment. As I went through each record I would increment a counter or add to the sum variables I would use these later in the header record. 

    I noticed a new Row count component, I tried to use it and it would work alright with the exception of trying to add  the variable to the header property. It has to have an interger as the variable and when I tried to add it to the header property, which it needed a string, so I tried casting it to the (DT_WSTR, 5) it would never give me the value. It was alway 0.

    So, I just wanted somone else's thoughts or ideas about this. Do I continue to use the script component to accomplish this type of task or is there a better way now? 

     

    Thanks everyone.

         

  • Rowcount should work successfully. If I were you I would have an integer variable called "MyRowcount" that is populated by the RowCount component.

    Then, have a string variable called "MyRowcount_str". In the properties pane set:

    • EvaluateAsExpression=TRUE
    • Expression="(DT_WSTR, 5)"

    You will then be able to reference "MyRowcount_str" wherever you need to!Let me know how that goes.

     

    -Jamie

     

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply