Jump to content
We've recently updated our Privacy Statement, available here ×

running total in tMap


momanning

Recommended Posts

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

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...