Need count of records being populated
Moderators: chulett, rschirm, roy
Need count of records being populated
Hi,
The job i designed generates a sequence number in the transformer stage.I want the total count of the sequence number in the target.
For example if the sequence number is from 1 to 10 then i want the count as 10 in the next stage.Help me in this regard.
Thanks,
Sengs
The job i designed generates a sequence number in the transformer stage.I want the total count of the sequence number in the target.
For example if the sequence number is from 1 to 10 then i want the count as 10 in the next stage.Help me in this regard.
Thanks,
Sengs
Re: Need count of records being populated
Hi
You can do it using Agg stage. select count option in teh group by option. U will get the total count.
JRK
You can do it using Agg stage. select count option in teh group by option. U will get the total count.
JRK
sengs wrote:Hi,
The job i designed generates a sequence number in the transformer stage.I want the total count of the sequence number in the target.
For example if the sequence number is from 1 to 10 then i want the count as 10 in the next stage.Help me in this regard.
Thanks,
Sengs
Re: Need count of records being populated
Hi ravi,
i tried using the aggregator.But it is also not giving me the total count.Instead it is giving me a sequence number like 1,2,3...10 again.
Thanks,
sengs
i tried using the aggregator.But it is also not giving me the total count.Instead it is giving me a sequence number like 1,2,3...10 again.
Thanks,
sengs
Re: Need count of records being populated
The input to the aggregator would be the sequence number, the ouput would be a single column with the derivation as the count().sengs wrote:Hi ravi,
i tried using the aggregator.But it is also not giving me the total count.Instead it is giving me a sequence number like 1,2,3...10 again.
Thanks,
sengs
If you use @OUTROWNUM then your derivation would be max() for the @OUTROWNUM column.Hi Sengs,
Your Question is not very clear.
If you generate the Sequence No's in a transformer, "@OUTROWNUM" will contain the count.
Success consists of getting up just one more time than you fall.
-
- Participant
- Posts: 31
- Joined: Mon Dec 01, 2003 6:24 am
- Location: London
The quickest way is probably to use a hashed file.
Create 2 columns. Hard-code the first column with a value such as 'X' and make this the key column in your hashed file. Set the derivation for the other column in your transformer to @OUTROWNUM.
As the rows pass through the hashed file they will be de-duped based on the hard-coded key and you will be left with a single row containing the highest value that @OUTROWNUM reached ie your rowcount
Create 2 columns. Hard-code the first column with a value such as 'X' and make this the key column in your hashed file. Set the derivation for the other column in your transformer to @OUTROWNUM.
As the rows pass through the hashed file they will be de-duped based on the hard-coded key and you will be left with a single row containing the highest value that @OUTROWNUM reached ie your rowcount
Re: Need count of records being populated
If you use @OUTROWNUM then your derivation would be max() for the @OUTROWNUM column.[/quote]Hi Sengs,
Your Question is not very clear.
If you generate the Sequence No's in a transformer, "@OUTROWNUM" will contain the count.
Hi ravi,
i am generating the sequence number in the transformer stage by giving the derivation as @outrownum. But when i take max of @outrownum in the aggregator it still returns the value as 1,2,3,4.....N
My requirement is i want the value 'N' and i am using this value in an another sequence job.The value of 'N' will be differing every time when i run the job with certain parameter.
Thanks,
Senguttuvan
Hi ,jenkinsrob wrote:The quickest way is probably to use a hashed file.
Create 2 columns. Hard-code the first column with a value such as 'X' and make this the key column in your hashed file. Set the derivation for the other column in your transformer to @OUTROWNUM.
As the rows pass through the hashed file they will be de-duped based on the hard-coded key and you will be left with a single row containing the highest value that @OUTROWNUM reached ie your rowcount
Can you please explain this with an example.I could not understand your statement "As the rows pass through the hashed file they will be de-duped based on the hard-coded key and you will be left with a single row containing the highest value that @OUTROWNUM reached ie your rowcount".
Thanks,
sengs
Since the key column is hard coded in the transformer(say with value 'X'), when first time it is written to Hashed File a row with 'X' as the primary key (and a non key column)would be created. Next time when it will again write another row with 'X' as the primary key (and other non key column)it will get overwritten (or in other word updated), since this column is the primary key.sengs wrote:Hi ,jenkinsrob wrote:The quickest way is probably to use a hashed file.
Create 2 columns. Hard-code the first column with a value such as 'X' and make this the key column in your hashed file. Set the derivation for the other column in your transformer to @OUTROWNUM.
As the rows pass through the hashed file they will be de-duped based on the hard-coded key and you will be left with a single row containing the highest value that @OUTROWNUM reached ie your rowcount
Can you please explain this with an example.I could not understand your statement "As the rows pass through the hashed file they will be de-duped based on the hard-coded key and you will be left with a single row containing the highest value that @OUTROWNUM reached ie your rowcount".
Thanks,
sengs
Success consists of getting up just one more time than you fall.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Re: Need count of records being populated
You can not get the final count until the last row has been processed. Think about what happens.sengs wrote:Hi ravi,
i tried using the aggregator.But it is also not giving me the total count.Instead it is giving me a sequence number like 1,2,3...10 again.
Thanks,
sengs
Read the other suggestions (Transformer stage, Aggregator stage using Last, Aggregator stage using Count). All will work for you.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.