running total in tMap

0
Hello
I am new to the ETL tool and I am trying to run a set of row thru a tMap component and count the different types of status' in one column of the input, then output one row to a target db. For example, the input status column can have values 1-10, as the rows flow thru, I keep a running total of how many 1s, how many 2s etc. At the end I output one rwo to the target db:
sourceId, stat1count, stat2count, .. stat10count.

In the middle pane of tMap I have defined Vars for each status count and connect the input status column to each of those vars, then in the Expression editor I have:
if ($row1[STATUS] == 4)
{
cs4++;
}

But the source code of the Job Design has:
$Var[Var__cs4] = if ($row1[row1__STATUS] == 4)
{
cs4++;
};
which is an error.

Am I approaching this incorrectly? An hints, suggestions or pointers to doc examples would be great.

See attached jpg

Thx
Mo
momanning's picture
Joined: Jan 31 2007 - 6:43am
Last seen: 12 years 10 months ago

0 Answers:

No answers yet
Feedback