• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 306
  • Last Modified:

Store Data Flow Totals in variables

How can I store totals from my dataflow dataset into variables?

Currently, I collect my target dataset from SQL, manipulate it, apply conitional filtering, etc. Once the dataset is the way I want it in memory, I use Multicast to copy the dataset. On the copy, I use an Aggregate Tranform to get the count & a sum of a column. Now I need to load these 2 aggregate values in a variable.

If there is a better way to get these totals into variables other than splitting off the dataset using Multicast & an aggregate, let me know. One thing I can't do is handle all of this in the initial SQL script. The totals need to be based on the dataset in memory that was built in my Data Flow.
 
0
JeepGeekin
Asked:
JeepGeekin
  • 5
  • 3
1 Solution
 
JeepGeekinAuthor Commented:
Also, I better mention that the dataset gets dumped in a text file at the end of this data flow. That's why I copied it to get my aggregrate totals.
0
 
vdr1620Commented:
you can use record set destination but..its not advisable

if you can specify the exact filtering conditions and agrregation level with your sql...We can suggest you a way to handle everything using Sql code.
0
 
JeepGeekinAuthor Commented:
I think the main thing I am doing that I cannot do in a SQL script is to merge data with a flat file. Then we do some cleanup after that before aggregating it.
0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
JeepGeekinAuthor Commented:
What about using a Script component? I haven't used one yet, but I see a place for variable interaction.
0
 
vdr1620Commented:
Since you are actually trying to store the values of your dataset into variables ..so that they can be used in the next task in Control flow..Script Component wouldn't be of much help..

Where do you want to use these values stored in variable?
0
 
JeepGeekinAuthor Commented:
In a script task in the control flow. I need to make some decisions in this based on the totals.
0
 
vdr1620Commented:
why do you want o store the values in the variable..i would suggest you to derive those decisions using script component instead of storing the values in variables and using them later on in script task

I would like to know what you are exactly trying to do .. to help you better
0
 
JeepGeekinAuthor Commented:
I got that to work. Good suggestion. Thanks vdr1620.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now