Need help to do vertical and horizontal pivoting at same time and problem is that FACT columns may vary every time.
Input file -
MRKT|PROD|PRD|FACT1|FACT2|FACT3|FACT4
M1|P1|PR1|F11|F12|F13|F14
M1|P1|PR2|F21|F22|F23|F24
M1|P1|PR3|F31|F32|F33|F34
M2|P2|PR1|F41|F42|F43|F44
M2|P2|PR2|F51|F53|F54|F55
M2|P2|PR3|F61|F64|F65|F66
out put file -
MRKT|PROD|FACT|PR1|PR2|PR3
M1|P1|FACT1|F11|F21|F31
M1|P1|FACT2|F12|F22|F32
M1|P1|FACT3|F13|F23|F33
M1|P1|FACT4|F14|F24|F34
M2|P2|FACT1|F41|F51|F61
M2|P2|FACT2|F42|F52|F62
M2|P2|FACT3|F43|F53|F63
M2|P2|FACT4|F44|F54|F64
Please advice how to chieve this in datastage
vertial & horizontal pivoting with variable number of co
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 4
- Joined: Tue Feb 10, 2009 12:51 am
- Location: Schaumburg
-
- Participant
- Posts: 437
- Joined: Fri Oct 15, 2004 6:13 am
- Location: Pune, India
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 4
- Joined: Tue Feb 10, 2009 12:51 am
- Location: Schaumburg
-
- Participant
- Posts: 4
- Joined: Tue Feb 10, 2009 12:51 am
- Location: Schaumburg
We need to develp a job so that we can create two different type of reports in xl file. For one key will be Market,Product ,Period and values will be fact and for one key will be Market,Product and fact and value will be a period.
But we have variable number of columns for period and fact . Means data may be like this as well.
MRKT|PROD|PRD|FACT1|FACT2|FACT3|FACT4
M1|P1|PR1|F11|F12|F13|F14
M1|P1|PR2|F21|F22|F23|F24
M2|P2|PR1|F41|F42|F43|F44
M2|P2|PR2|F51|F53|F54|F55
M2|P2|PR3|F61|F64|F65|F66
M3|P3|PR3|F31|F32||
But we have variable number of columns for period and fact . Means data may be like this as well.
MRKT|PROD|PRD|FACT1|FACT2|FACT3|FACT4
M1|P1|PR1|F11|F12|F13|F14
M1|P1|PR2|F21|F22|F23|F24
M2|P2|PR1|F41|F42|F43|F44
M2|P2|PR2|F51|F53|F54|F55
M2|P2|PR3|F61|F64|F65|F66
M3|P3|PR3|F31|F32||
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom