# taking input from other nodes

Hey!

I have a group by node that displays sum of volumes of certain stocks. So, the output is something like this:
SCRIPT                   Sum(Qty)
500103                   152136
500325                   891839
500696                   295882

Going further, I have 2 nodes not connected through this output, and then there comes a "Math Formula" node which calculates a parameter (percentage) as follows:
(\$Sum(QTY)\$/152136)*100 for script 500103 (obtained by using row filter). Sum(Qty) is for a particular trader only, not the whole sum as earlier.
{Explanation of Workflow: Various traders trade in various securities. So, I have firstly found the total sum of volume script wise regardless of trader. Now, after filtering for every script, I find how much volume every trader has executed. And finally I move on to the Math Formula node to calculate the percentage}

But the thing is, I am manually typing "152136" in the percentage formula. Any way I could fetch this value directly from the output table previously that contained script wise sum of volumes? So that when I use this formula for, say script 500325, i won't have to enter manually 891839.

I've attached the workflow
- -
Thanx and regards,
Anupam

Hi Anupam,

I believe what you are looking for here is a joiner node.  I've update your example.  Also, I added a loop to calculate these results for all script IDs.  If that isn't what you need, sorry but I couldn't help myself.  I did rename some columns, so before you rely on the results at all, I would check to make sure everything is still as you had it (I believe it is). Let us know if this is what you were looking for.

Cheers,

Aaron

Hi Aaron!

The loop and joining features are cool, although I'm still stuck.

It doesn't serve the purpose of automation! I will still have to enter values in the math formula by my own. I wish to eliminate that.

How to enter sum of volume for a script directly in the math formula?

Hi Anupam,

I just got the following Tip & Trick:

Node Configurations as Variables

Did you know that you can make the configurations set in a node available as a variable. Simply go to the flow variables tab and next to the node configuration you want recorded, in the empty white box enter a name for the variable. This is now available in the rest of the workflow under the given name.

In the Flow Control/Variables/Java Edit Variable node you can modify (or create new) the content of the variable. (And later set this value in Flow Variables tab after you connected it to the node.) Naturally you can use the other nodes from that group too.

In case the looping over all of them is not desired, you can use Workflow variables (sorry, no link, I thought http://tech.knime.org/workbench would describe them, but it seems it is somewhere else; you can set them from the right-click menu of the workflow), or even the HiLite Filter for easier selection of the options to generate. (Sorry, I have not checked your workflow in depth, so maybe you already aware of these.)

Cheers, gabor

Hi Anupum,

Sorry for not being clear there.  The first joiner node is used to create the columns used in the calculation.  I originally only edited the branch that you pointed to in your annotation (but then I deleted the annotation and did an auto-layout which hid my changes). I've gone an updated all the branches in the loop now, have a look.

perfect!

Thanks a lot Aaron