Hi All,
I have this problem as described below-
I have input records as below:
P Q (P and Q are column names)
1. A
2. B
3. C
4. D
5. E
6. F
Now I need output like
W X Y Z (W, X, Y and Z are column names)
1. A B C
2. D E
3. F ..
Any help will be appreciated. Thanks in advance.
Sylvan Rydes
Problems changing rows in column
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 47
- Joined: Wed Apr 12, 2006 12:13 pm
Problems changing rows in column
sylvan rydes
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
No, the requirement is for a vertical pivot. The Pivot stage only does horizontal pivots.
I can not see any logic in the example for determining which rows accumulate into columns. Did you give erroneous values for the P column?
Search the forum for "Vertical Pivot" to find some techniques. Make sure that the data are grouped (partitioned) by the P column.
I can not see any logic in the example for determining which rows accumulate into columns. Did you give erroneous values for the P column?
Search the forum for "Vertical Pivot" to find some techniques. Make sure that the data are grouped (partitioned) by the P column.
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.
-
- Participant
- Posts: 47
- Joined: Wed Apr 12, 2006 12:13 pm
Even via datastage you can get this done but we need logic. I bet even the stored procedure executes some sort of logic. If you can get us that logic maybe someone can help you design you, or even walk you through the entire job.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Participant
- Posts: 47
- Joined: Wed Apr 12, 2006 12:13 pm
Hi All,
I m here to define the problem in detail. We have two address input. But one address to copied 3 times and the second one is copied 2 times in a target. All address belong to same person. Now for two address we have output table having 5 serial number for address. In next table we are again dividing these 5 in two but using the serial number now.
In store procedure we are generating same number in both the target tables but in datastage as we ave one job per target table so it is becoming a problem.
Thanks again for all your help.
Sylvan_rydes
I m here to define the problem in detail. We have two address input. But one address to copied 3 times and the second one is copied 2 times in a target. All address belong to same person. Now for two address we have output table having 5 serial number for address. In next table we are again dividing these 5 in two but using the serial number now.
In store procedure we are generating same number in both the target tables but in datastage as we ave one job per target table so it is becoming a problem.
Thanks again for all your help.
Sylvan_rydes
sylvan rydes
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
So, basically, the requirement is to sort by address and group by (a newly generated) serial number?
Sort the addresses with a Sort stage, then use a Transformer stage to detect changes and generate the serial number, incrementing when the value changes. Run in sequential mode or partition by hash on address so that all members of each group are on the same partition.
Sort the addresses with a Sort stage, then use a Transformer stage to detect changes and generate the serial number, incrementing when the value changes. Run in sequential mode or partition by hash on address so that all members of each group are on the same partition.
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.