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.
I'm expecting row headings and columns heading as above and totals at the end of the last bucket. Each bucket can have 8 columns(1 row headings columns and 7 columns after the transpose of columns into rows). The number of buckets will dependent on number of rows/7 . I have using OVER command and adjusted the space and I'm getting the format as below.
I have tried different ways but I'm not getting the row headings from bucket2. Can someone, please help me.This message has been edited. Last edited by: FP Mod Chuck,
Posts: 17 | Location: columbus | Registered: August 01, 2018
When posting sample result or code, please use the code tag. Last one on the ribbon
</>
As far as I can understand SET BYPANEL=ON won't work for you because that SET apply on BY fields and the OVER ones are not BY fields A not that simple option could be the below. But it need to create a HOLD file for each Col (the OVER fields)
Another option may be to use the OPEN/CLOSE feature for PDF file (compound PDF) with a loop where each loop will only include its own Row list. Loop 1 Row 1-7 PCHOLD FORMAT PDF OPEN, Loop 2 Row 8-14 PCHOLD FORMAT PDF, ... , Loop X Row xx-yy PCHOLD FORMAT PDF CLOSE But I have not explored that option And possibly many more options may suits the need such as MacGyver technic
TABLE FILE CAR
SUM DEALER_COST/D8 AS 'MEAS'
BY COUNTRY
BY TOTAL COMPUTE DUMROW /I2 = 1;
BY TOTAL COMPUTE DUMTXT /A20V = 'Dealer Cost';
BY CAR
ON TABLE HOLD AS FILROW1
END
-RUN
TABLE FILE CAR
SUM RETAIL_COST/D8 AS 'MEAS'
BY COUNTRY
BY TOTAL COMPUTE DUMROW /I2 = 2;
BY TOTAL COMPUTE DUMTXT /A20V = 'Retail Cost';
BY CAR
ON TABLE HOLD AS FILROW2
END
-RUN
TABLE FILE CAR
SUM SEATS/D8 AS 'MEAS'
BY COUNTRY
BY TOTAL COMPUTE DUMROW /I2 = 3;
BY TOTAL COMPUTE DUMTXT /A20V = 'Seats';
BY CAR
ON TABLE HOLD AS FILROW3
END
-RUN
TABLE FILE FILROW1
SUM MEAS
BY COUNTRY
BY DUMROW
BY DUMTXT
BY TOTAL COMPUTE COLID /I2 = 1;
BY CAR
ON TABLE HOLD AS DETDATA
MORE
FILE FILROW2
MORE
FILE FILROW3
END
-RUN
TABLE FILE DETDATA
SUM MEAS
BY COUNTRY
BY DUMROW
BY DUMTXT
BY TOTAL COMPUTE COLID /I2 = 99;
BY TOTAL COMPUTE CAR /A16 = 'Total';
ON TABLE HOLD AS TOTDATA
END
-RUN
TABLE FILE DETDATA
SUM MEAS
BY COUNTRY
BY DUMROW
BY DUMTXT
BY COLID
BY CAR
ON TABLE HOLD AS RPTDATA
MORE
FILE TOTDATA
END
-RUN
TABLE FILE RPTDATA
SUM MEAS AS ''
BY COUNTRY
BY DUMROW NOPRINT
BY DUMTXT AS ''
ACROSS COLID NOPRINT
ACROSS CAR AS ''
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET BYPANEL ON
END
-RUN
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013
I see this thread is closed. Nonetheless, I love a challenge so here is a FOCUS-type solution:
-SET &ECHO=ALL;
-* &N - Number of columns per bucket
-DEFAULT &N=7
-* Data
FILEDEF JARVES DISK JARVES.TXT
-RUN
-WRITE JARVES Row1 100 100 100 100 100
-WRITE JARVES Row2 200 200 200 200 200
-WRITE JARVES Row3 300 300 300 300 300
-WRITE JARVES Row4 400 400 400 400 400
-WRITE JARVES Row5 500 500 500 500 500
-WRITE JARVES Row6 600 600 600 600 600
-WRITE JARVES Row7 700 700 700 700 700
-WRITE JARVES Row8 800 800 800 800 800
-WRITE JARVES Row9 900 900 900 900 900
-WRITE JARVES Row10 1000 1000 1000 1000 1000
-RUN
-* Master file for the data
EX -LINES 10 EDAPUT MASTER,JARVES,C,MEM
FILENAME=JARVES, SUFFIX=FIX
SEGNAME=JARVES, SEGTYPE=S0, $
FIELDNAME=HEAD, USAGE=A7, ACTUAL=A7, $
FIELDNAME=COL1, USAGE=I5, ACTUAL=A5, $
FIELDNAME=COL2, USAGE=I5, ACTUAL=A5, $
FIELDNAME=COL3, USAGE=I5, ACTUAL=A5, $
FIELDNAME=COL4, USAGE=I5, ACTUAL=A5, $
FIELDNAME=COL5, USAGE=I5, ACTUAL=A5, $
-RUN
-* Read the data. Change all formats to have the same length (here 7, because of the HEADING)
-* LL: Number each record and reset the numbering after &N records
-* PP: Number the buckets
TABLE FILE JARVES
PRINT
COMPUTE LL/I3=IF LAST LL EQ &N*10 THEN 10 ELSE LAST LL + 10;
COMPUTE PP/I3=IF LL EQ 10 THEN LAST PP + 1 ELSE LAST PP;
HEAD COL1/I7 COL2/I7 COL3/I7 COL4/I7 COL5/I7
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS J1 FORMAT ALPHA
END
-RUN
-* Now the tricky part: add a record containing the totals
-* It should be in the last bucket in the next column
-* Note: One should check if the number of rows is a multiple of 7. I didn't!
TABLE FILE J1
SUM MAX.PP LST.LL
ON TABLE HOLD AS PP
END
-RUN
-READFILE PP
-SET &LL=&LL+10;
-* Save the number of buckets
-SET &BUCKETS=&PP;
-RUN
-* Totals appended to the rows
FILEDEF J1 DISK J1.FTM (APPEND
TABLE FILE JARVES
SUM
COMPUTE
LL/I3=&LL;
PP/I3=&PP;
TOTS/A7='Totals';
COL1/I7 COL2/I7 COL3/I7 COL4/I7 COL5/I7
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE AS J1
END
-RUN
-* Even trickier: create column heading records, one per bucket
DEFINE FILE J1
XLL/I3 WITH LL=0;
XPP/I3=1 + LAST XPP;
XHEAD/A7='HEADING';
XCOL1/A7='COL1';
XCOL2/A7='COL2';
XCOL3/A7='COL3';
XCOL4/A7='COL4';
XCOL5/A7='COL5';
END
TABLE FILE J1
PRINT
XLL
XPP
XHEAD
XCOL1
XCOL2
XCOL3
XCOL4
XCOL5
IF READLIMIT EQ &BUCKETS
ON TABLE HOLD AS J2 FORMAT ALPHA
END
-RUN
-* And append the rows
FILEDEF J2 DISK J2.FTM (APPEND
TABLEF FILE J1
PRINT *
ON TABLE SAVE AS J2
END
-RUN
-* Last trick: alternate master
-* this will allow to pivot columns to rows and create the buckets
EX -LINES 8 EDAPUT MASTER,JJ,C,MEM
FILENAME=J2 , SUFFIX=FIX
SEGMENT=J2, SEGTYPE=S0, $
FIELDNAME=XLL, ALIAS=E01, USAGE=I3, ACTUAL=A03, $
FIELDNAME=XPP, ALIAS=E02, USAGE=I3, ACTUAL=A03, $
SEGMENT=DATA, PARENT=J2, OCCURS=VARIABLE
FIELDNAME=XVAL, ALIAS=XVAL, USAGE=A7, ACTUAL=A07, $
FIELDNAME=XNUM, ALIAS=ORDER, USAGE=I4, ACTUAL=I4, $
-RUN
-* OUTPUT!
FILEDEF JJ DISK J2.FTM
TABLE FILE JJ
SUM XVAL
BY XPP NOPRINT SUBFOOT
" "
BY XNUM NOPRINT
ACROSS XLL NOPRINT
END
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
Jarves, I'm glad that this solved your request. Your problem with the grids is that "border" is not an attribute that can be changed by WHEN. You could ask for a New Feature...
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