Just i want to know how to combine identical rows(date)in a column
sample data
date ro_code desc mv sv uv C
01/10/2006 12 REGION 0 1 0 0
02/10/2006 12 REGION 0 1 0 0
03/10/2006 12 REGION 0 1 1 0
01/10/2006 12 REGION 0 0 1 0
02/10/2006 12 REGION 0 0 1 0
CAN ANYONE PLZ HELP ME HOW TO COMBINE IDENTICAL ROWS LIKE ROW1 AND ROW 3 HAVING SAME DATE, ROCODE AND DESC. AND ROW2 AND
ROW 4
AS WELL..
THANK U
Combinine two or more identical rows
Moderators: chulett, rschirm, roy
Combinine two or more identical rows
prabakaran.v
-
- Participant
- Posts: 612
- Joined: Thu May 03, 2007 4:59 am
- Location: Melbourne
Use stage variables in transformer and adopt remove duplicate strategy to merge fields. Explore Sort stage with keychange as well.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
-
- Participant
- Posts: 78
- Joined: Fri Mar 02, 2007 4:54 am
- Location: CHENNAI
As Arndw said you can do it by using logical "or" operator.
Take your ouput as hash file and use the same hash file for reference in the same job.
Then take 4 stage variables for Date and Row_cd.
E.g:
Pre_Date->HshFile.Date,Curr_Date->SeqFile.Date lly for row_cd.
Then take one temp stage variable and write the logic in it as:
"If (Pre_Date <> Curr_Date ) Or (Pre_RowCd <> Curr_RowCd) Then
"N"
Else
(Seq.mv Or DSLink6.mv):(Seq.sv Or DSLink6.sv):(Seq.uv Or Hsh.uv):(Seq.C Or Hsh.C)"
Then in your hash file write as
OuputHshFile.mv->"If Varmv <> "N" Then Varmv[1,1] Else DSLink4.mv"
Similarly for others
Take your ouput as hash file and use the same hash file for reference in the same job.
Then take 4 stage variables for Date and Row_cd.
E.g:
Pre_Date->HshFile.Date,Curr_Date->SeqFile.Date lly for row_cd.
Then take one temp stage variable and write the logic in it as:
"If (Pre_Date <> Curr_Date ) Or (Pre_RowCd <> Curr_RowCd) Then
"N"
Else
(Seq.mv Or DSLink6.mv):(Seq.sv Or DSLink6.sv):(Seq.uv Or Hsh.uv):(Seq.C Or Hsh.C)"
Then in your hash file write as
OuputHshFile.mv->"If Varmv <> "N" Then Varmv[1,1] Else DSLink4.mv"
Similarly for others