As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
Read-Only TopicGo
Search
Notify
Admin
New PM!
Member posted December 15, 2011 11:48 AM
I need to transpose some data.
I have data in this format that goes out to 280 columns:
P_W P W Week_num Cur_week 1 2 3 4
01-1 01 1 1 16 50 2 8 60
01-2 01 2 2 16 40 5 5 50
01-3 01 3 3 16 20 5 5 30
01-4 01 4 4 16 10 5 5 20
02-1 02 1 5 16 10 5 5 20
I need it in this format:
P_W 01-1 01-2 01-3 01-4 02-1
P 01 01 01 01 02
W 1 2 3 4 5
Cur_week 16 16 16 16 16
1 50 40 20 10 10
2 2 5 5 5 5
3 8 5 5 5 5
4 60 50 30 20 20
Thanks!
This message has been edited. Last edited by: Kerry , December 27, 2011 11:58 AM 7.6.8 UNIX FOCUS,HTML,PDF,EXCEL.
Virtuoso Try OVER FIELD1 OVER FIELD2
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005
IP
Member I think thier is a limit on the number of Over commands you can use.
7.6.8 UNIX FOCUS,HTML,PDF,EXCEL.
Expert Macgyver is always an option.
Waz... Prod: WebFOCUS 7.6.10/8.1.04 Upgrade: WebFOCUS 8.2.07 OS: Linux Outputs: HTML, PDF, Excel, PPT In Focus since 1984 Pity the lost knowledge of an old programmer!
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006
IP
Ignored post by
Waz
posted
December 15, 2011 03:33 PM Show Post
Gold member Todd,
Using Waz suggestion of MacGyver, see if this works for you:
-* File test_121611.fex
TABLE FILE CAR
PRINT
COMPUTE P_W/A4 = ' ';
COMPUTE P1/A2 = ' ';
COMPUTE W1/A1 = ' ';
COMPUTE Week_Num/A1 = ' ';
COMPUTE Cur_Week/A2 = ' ';
COMPUTE F1/A2 = ' ';
COMPUTE F2/A1 = ' ';
COMPUTE F3/A1 = ' ';
COMPUTE F4/A2 = ' ';
COMPUTE SP/A1 = 'X';
COMPUTE REC/I5 = 0;
BY COUNTRY NOPRINT
IF RECORDLIMIT EQ 1
ON TABLE HOLD AS TODDJ FORMAT ALPHA
END
-RUN
-WRITE TODDJ 01-1011116502860X 1
-WRITE TODDJ 01-2012216405550X 2
-WRITE TODDJ 01-3013316205530X 3
-WRITE TODDJ 01-4014416105520X 4
-WRITE TODDJ 02-1021516105520X 5
-CLOSE TODDJ
-*
TABLE FILE TODDJ
PRINT *
ON TABLE HOLD AS TODDJ2
END
-RUN
-SET &RECS = &LINES;
-SET &OCCURS = 9;
-* build macgyver MFD
FILEDEF MCMAS DISK mcgyv.mas
-RUN
-WRITE MCMAS FILENAME=mcgyv, SUFFIX=FIX
-WRITE MCMAS SEGMENT=ONE, SEGTYPE = S0,$
-WRITE MCMAS FIELDNAME=SP,USAGE=A1,ACTUAL=A1,$
-WRITE MCMAS SEGMENT=TWO, SEGTYPE=S0,PARENT=ONE,OCCURS=&OCCURS ,$
-WRITE MCMAS FIELDNAME=CHAR1, USAGE=A1,ACTUAL=A1,$
-WRITE MCMAS FIELDNAME=CTR, ALIAS=ORDER,USAGE=I4,ACTUAL=I4,$
-*
FILEDEF MCGYV DISK mcbyv.ftm
-RUN
-* Control=X: used as Join cross reference target field
-WRITE MCGYV XABCDEFGHI
-RUN
JOIN SP IN TODDJ TO SP IN MCGYV AS J1
-RUN
DEFINE FILE TODDJ
COL1/A8 = DECODE CTR(1 'P_W'
2 'P'
3 'W'
4 'Week_Num'
5 'Cur_Week'
6 '1'
7 '2'
8 '3'
9 '4'
ELSE ' ');
-REPEAT ENDDEFLP FOR CT FROM 2 TO &RECS
COL&CT /A4 =
IF (CTR EQ 1) AND (REC EQ &CT ) THEN P_W
ELSE IF (CTR EQ 2) AND (REC EQ &CT ) THEN P1
ELSE IF (CTR EQ 3) AND (REC EQ &CT ) THEN W1
ELSE IF (CTR EQ 4) AND (REC EQ &CT ) THEN Week_Num
ELSE IF (CTR EQ 5) AND (REC EQ &CT ) THEN Cur_Week
ELSE IF (CTR EQ 6) AND (REC EQ &CT ) THEN F1
ELSE IF (CTR EQ 7) AND (REC EQ &CT ) THEN F2
ELSE IF (CTR EQ 8) AND (REC EQ &CT ) THEN F3
ELSE IF (CTR EQ 9) AND (REC EQ &CT ) THEN F4
ELSE ' ';
-ENDDEFLP
END
TABLE FILE TODDJ
SUM
MAX.COL1
-REPEAT ENDREPLP FOR RT FROM 2 TO &RECS
MAX.COL&RT
-ENDREPLP
BY CTR NOPRINT
END
WF 7.6.10, Windows, PDF, Excel
Posts: 75 | Location: Dallas, TX | Registered: February 12, 2004
IP
Expert ACROSS?
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005
IP
Virtuoso What do you mean by:
quote:
I have data in this format that goes out to 280 columns
280 fields in the MASTER?
And all not the same format?
And you want to show them down the page?
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006
IP
Please Wait. Your request is being processed...
Read-Only TopicCopyright © 1996-2020 Information Builders