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.
To show C4, change to 1 or 2 or 3, etc... To not show C4, keep at ZERO...
DEFINE FILE IBISAMP/CAR
C1/I5 WITH CAR = C1 + 1;
C2/I5 WITH SEATS = C2 + 1;
C3/I5 WITH CAR = C3 + 1;
C4/I5 WITH CAR = 0;
END
TABLE FILE IBISAMP/CAR
SUM
C1
C2
C3
C4
BY COUNTRY
ON TABLE HOLD FORMAT ALPHA
END
-RUN
TABLE FILE HOLD
SUM
MAX.C1
MAX.C2
MAX.C3
MAX.C4
ON TABLE HOLD AS MAXVALUE FORMAT ALPHA
END
-RUN
-READFILE MAXVALUE
-SET &SHOW_C1 = IF &C1 NE 0 THEN 'C1' ELSE '';
-SET &SHOW_C2 = IF &C2 NE 0 THEN 'C2' ELSE '';
-SET &SHOW_C3 = IF &C3 NE 0 THEN 'C3' ELSE '';
-SET &SHOW_C4 = IF &C4 NE 0 THEN 'C4' ELSE '';
TABLE FILE HOLD
SUM
&SHOW_C1.EVAL
&SHOW_C2.EVAL
&SHOW_C3.EVAL
&SHOW_C4.EVAL
BY COUNTRY
ON TABLE PCHOLD FORMAT HTMTABLE
END
-EXIT
Tom, Very nice! With a bit of trickery ( ), one pass on the data:
-SET &ECHO=ALL;
-* File rakesh01.fex
DEFINE FILE CAR
V1/I5 WITH CAR = V1 + 1;
V2/I5 WITH SEATS = V2 + 1;
V3/I5 WITH CAR = 0;
V4/I5 WITH MODEL = V4 + 1;
END
TABLE FILE CAR
SUM
MAX.V1 NOPRINT
MAX.V2 NOPRINT
MAX.V3 NOPRINT
MAX.V4 NOPRINT
SUM
V1
V2
V3
V4
BY COUNTRY
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE=ENDEFLT,
$
-REPEAT #ZERO FOR &I FROM 1 TO 4;
TYPE=DATA, COLUMN=V&I, SIZE=1, WHEN=MAX.V&I EQ 0,
$
TYPE=TITLE,COLUMN=V&I, SIZE=1, WHEN=MAX.V&I EQ 0,
$
-#ZERO
ENDSTYLE
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
Assuming (very dangerous to assume!) that in your procedure you have the different RUN fields and that they are FOCUS dates, here is another solution:
-SET &ECHO=ALL;
-* File rakesh01.fex
DEFINE FILE CAR
RUN0/DMYY='19/04/2014';
NUM/I3 WITH COUNTRY = NUM + 1;
RUN1/DMYY=RUN0 + NUM;
RUN2/DMYY=RUN0 + NUM*2;
RUN4/DMYY=RUN0 + NUM*7;
RUN3/DMYY=0;
END
TABLE FILE CAR
SUM
RUN1
RUN2
RUN3
RUN4
BY COUNTRY
ON TABLE SAVE AS RAK FORMAT ALPHA
END
-RUN
EX -LINES 7 EDAPUT MASTER,RAK,C,MEM
FILENAME=RAK, SUFFIX=FIX
SEGNAME=RAK, SEGTYPE=S0
FIELDNAME=COUNTRY, COUNTRY, A10, A10, $
SEGNAME=RUN, SEGTYPE=S0, PARENT=RAK, OCCURS=VARIABLE
FIELDNAME=RUN, RUN, DMYY, A8, $
FIELDNAME=CNTR, ORDER, I2, I4,$
-RUN
DEFINE FILE RAK
RNUM/A5='RUN' | EDIT(CNTR);
END
-RUN
SET ACROSSTITLE = SIDE
TABLE FILE RAK
SUM RUN
BY COUNTRY
ACROSS RNUM AS ''
IF RUN NE '31/12/1900';
ON TABLE SET HTMLCSS ON
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET STYLE *
INCLUDE=ENDEFLT,
$
ENDSTYLE
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
In your example, you want to avoid generating columns for RUN4 through RUN7 in your output, since their values are Null in every row. That can be accomplished in a number of ways, all of which would require use of dialog manager to dynamically control the list of verb objects in the TABLE request -- either to generate the lines of code listing the verb-objects (generating a blank line for the ones that are found to be all-null), or to conditionally insert keywords (NOPRINT or FOC_NONE) to obtain the same effect)
So you need to add a preprocessing step, before the TABLE request, that will define the necessary amper variables. There are a number of ways to skin the cat, but basically you need to define or compute a control variables for each column that may need to be suppressed, HOLD them in a SUM request, use -READFILE to render the control variables as amper variables, and then reference them in the TABLE request that delivers the report.
- Jack Gross WF through 8.1.05
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
Can you post some example elaborating your explanation.
Rakesh --
Sorry for the delay. Here's how I would do it (the code is untested)
DEFINE FILE xxx
date1count/I6=IF RUN1 IS MISSING THEN 0 ELSE 1;
date2count/I6=IF RUN2 IS MISSING THEN 0 ELSE 1;
date3count/I6=IF RUN3 IS MISSING THEN 0 ELSE 1;
. . .
END
TABLE FILE xxx
SUM COMPUTE
date1print/A8=IF SUM.date1count EQ 0 THEN 'NOPRINT' ELSE ' ';
date2print/A8=IF SUM.date2count EQ 0 THEN 'NOPRINT' ELSE ' ';
date3print/A8=IF SUM.date3count EQ 0 THEN 'NOPRINT' ELSE ' ';
. . .
ON TABLE HOLD AS 'CONTROL'
END
-RUN
-READFILE CONTROL
-? &date
TABLE FILE xxx
SUM
RUN1 &date1print
RUN2 &date2print
RUN2 &date3print
etc.
BY ID
. . .
END
Note to the regulars: I believe the same idea will work using FOC_NONE rather than NOPRINT; if you truncate the control variables and append them to the column-heading
RUN1 AS 'HEADING,FOR DATE 1&date1print'
then you may be able to preserve GUI-compatibility, with minimal effect on the report (adding one trailing space to headings).
- Jack Gross WF through 8.1.05
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005