locked
using row count transform in a loop RRS feed

  • Question

  • Hi,

    i am trying to use row count transformation in a dataflow and able to store the value in a variable but as it is in the loop for the next file the value getting default to zero and i want it to add up with the first occurance value.

    like if the first file has 100 rows and second file has 200 then i want the total 300 value in my variable

    how can i achieve this?

    Thanks,

    Eshwar

    Wednesday, September 7, 2011 9:30 AM

Answers

  • Hi,

    I believe you are using Foreach loop for all files and Inside that DFT

    if you want incremental row count then create one script task and place after DFT in foreach loop and use another variable to store total rowcount inside script Task.

     

    hope this helps


    Shailesh , Please mark the post as answered if it answers your question.
    • Proposed as answer by Jamie Thomson Wednesday, September 7, 2011 10:46 AM
    • Edited by Shailesh Rajak Wednesday, September 7, 2011 10:57 AM typo mistake
    • Marked as answer by Eileen Zhao Tuesday, September 13, 2011 10:09 AM
    Wednesday, September 7, 2011 9:58 AM
  • Hi,

    I believe you are using Foreach loop for all files and Inside that DFT

    if you want incremental row count then create one script task and place after DFT in foreach loop and use another variable to store total rowcount inside script component.

     

    hope this helps


    Shailesh , Please mark the post as answered if it answers your question.

    Shailesh is correct, though just to use the proper nomenclature and to make sure there's no confusion I think it should be this.

    "if you want incremental row count then create one script task and place after DFT in foreach loop and use another variable to store total rowcount inside script task."

     


    http://sqlblog.com/blogs/jamie_thomson/ | @jamiet | About me
    Jamie Thomson
    • Marked as answer by Eileen Zhao Tuesday, September 13, 2011 10:09 AM
    Wednesday, September 7, 2011 10:48 AM

All replies

  • Hi,

    I believe you are using Foreach loop for all files and Inside that DFT

    if you want incremental row count then create one script task and place after DFT in foreach loop and use another variable to store total rowcount inside script Task.

     

    hope this helps


    Shailesh , Please mark the post as answered if it answers your question.
    • Proposed as answer by Jamie Thomson Wednesday, September 7, 2011 10:46 AM
    • Edited by Shailesh Rajak Wednesday, September 7, 2011 10:57 AM typo mistake
    • Marked as answer by Eileen Zhao Tuesday, September 13, 2011 10:09 AM
    Wednesday, September 7, 2011 9:58 AM
  • Hi,

    I believe you are using Foreach loop for all files and Inside that DFT

    if you want incremental row count then create one script task and place after DFT in foreach loop and use another variable to store total rowcount inside script component.

     

    hope this helps


    Shailesh , Please mark the post as answered if it answers your question.

    Shailesh is correct, though just to use the proper nomenclature and to make sure there's no confusion I think it should be this.

    "if you want incremental row count then create one script task and place after DFT in foreach loop and use another variable to store total rowcount inside script task."

     


    http://sqlblog.com/blogs/jamie_thomson/ | @jamiet | About me
    Jamie Thomson
    • Marked as answer by Eileen Zhao Tuesday, September 13, 2011 10:09 AM
    Wednesday, September 7, 2011 10:48 AM
  • Thanks Jamie for correction.

    Shailesh , Please mark the post as answered if it answers your question.
    Wednesday, September 7, 2011 10:58 AM