Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] How to add multiple data from a field to a Header

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] How to add multiple data from a field to a Header
 Login/Join
 
Gold member
posted
Please forgive me if I'm not asking this question appropriatly. I really don't know how to word it. I've tried to recreate the scenario using the Car File. See below:
TABLE FILE CAR
PRINT
CAR.BODY.BODYTYPE
CAR.BODY.SEATS
CAR.BODY.DEALER_COST
CAR.BODY.RETAIL_COST
CAR.BODY.SALES
CAR.SPECS.LENGTH
CAR.SPECS.WIDTH
CAR.SPECS.HEIGHT
CAR.SPECS.WEIGHT
CAR.SPECS.WHEELBASE
CAR.SPECS.FUEL_CAP
BY CAR.ORIGIN.COUNTRY NOPRINT
BY CAR.COMP.CAR NOPRINT
BY CAR.CARREC.MODEL NOPRINT
ON CAR.CARREC.MODEL PAGE-BREAK
HEADING
"DATE: &DATEMDYY"
"CAR FILE"
"Country:"Model: "Other Model(s): "
END

What I'm trying to do is populate the 'Other Model:' in the header with the other models of a given Car. For example,the ALFA ROMEO, on the page that list the MODEL as 'Model: 2000 4 DOOR BERLINA' I'd like the OTHER MODEL to read 'Other Model(s): 2000 GT VELOCE, 2000 SPIDER VELOCE'.

Can someone please tell me how to approach this.

This message has been edited. Last edited by: kitten,


WebFOCUS 7.6.2, MS Windows Server/______, Excel, PDF, HTML
 
Posts: 91 | Registered: May 15, 2008Report This Post
Expert
posted Hide Post
One slightly convoluted method of achieving what (I think) you want -

TABLE FILE CAR
PRINT COMPUTE OTH_MODEL/A200V = IF COUNTRY NE LAST COUNTRY THEN MODEL
                           ELSE IF CAR     NE LAST CAR     THEN MODEL
                           ELSE LAST OTH_MODEL || (', '|MODEL);
      COMPUTE KEY/A40 = COUNTRY || CAR;
   BY COUNTRY  
   BY CAR      
ON TABLE HOLD AS TEMPCAR1
END
-RUN
TABLE FILE TEMPCAR1
  SUM LST.OTH_MODEL
   BY KEY
ON TABLE HOLD AS TEMPCAR2 FORMAT FOCUS INDEX KEY
END
-RUN
JOIN CLEAR *
JOIN KEY WITH CAR IN CAR TO KEY IN TEMPCAR2 AS J1
DEFINE FILE CAR
  KEY/A40 WITH CAR = COUNTRY || CAR;
END
TABLE FILE CAR
PRINT BODYTYPE
      SEATS
      DEALER_COST
      RETAIL_COST
      SALES
      LENGTH
      WIDTH
      HEIGHT
      WEIGHT
      WHEELBASE
      FUEL_CAP
   BY COUNTRY  NOPRINT
   BY CAR      NOPRINT
   BY MODEL    NOPRINT
ON CAR PAGE-BREAK
HEADING
"DATE: &DATEMDYY"
"CAR FILE"
"Country: <COUNTRY Car: <CAR Other Model(s): <OTH_MODEL"
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
  TYPE=HEADING, LINE=3, ITEM=2, COLOR=BLUE, $
  TYPE=HEADING, LINE=3, ITEM=4, COLOR=BLUE, $
  TYPE=HEADING, LINE=3, ITEM=6, COLOR=BLUE, $
ENDSTYLE
END

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Gold member
posted Hide Post
Not convoluted at all...I made some changes to get closer to what I wanted there's just one problem...run the code below and it will be a little clearer... Is there any way to not repeat the Model on a page in the Other Model list on the same page.

TABLE FILE CAR
PRINT COMPUTE OTH_MODEL/A200V = IF COUNTRY NE LAST COUNTRY THEN MODEL
ELSE IF CAR NE LAST CAR THEN MODEL
ELSE LAST OTH_MODEL || (', '|MODEL);
COMPUTE KEY/A40 = COUNTRY || CAR;
BY COUNTRY
BY CAR
BY MODEL
ON TABLE HOLD AS TEMPCAR1
END
-RUN
TABLE FILE TEMPCAR1
SUM LST.OTH_MODEL
BY KEY
ON TABLE HOLD AS TEMPCAR2 FORMAT FOCUS INDEX KEY
END
-RUN
JOIN CLEAR *
JOIN KEY WITH CAR IN CAR TO KEY IN TEMPCAR2 AS J1
DEFINE FILE CAR
KEY/A40 WITH CAR = COUNTRY || CAR;
END
TABLE FILE CAR
PRINT BODYTYPE
SEATS
DEALER_COST
RETAIL_COST
SALES
LENGTH
WIDTH
HEIGHT
WEIGHT
WHEELBASE
FUEL_CAP
BY COUNTRY NOPRINT
BY CAR NOPRINT
BY MODEL NOPRINT
ON CAR.CARREC.MODEL PAGE-BREAK
HEADING
"DATE: &DATEMDYY"
"CAR FILE"
"Country: "Model: "Other Model(s): ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
TYPE=REPORT,
GRAPHCOLOR='GREEN',
$
TYPE=HEADING,
LINE=1,
JUSTIFY=LEFT,
$
TYPE=HEADING,
LINE=2,
JUSTIFY=LEFT,
$
TYPE=HEADING,
LINE=3,
JUSTIFY=LEFT,
$
TYPE=HEADING,
LINE=4,
JUSTIFY=LEFT,
$
TYPE=HEADING,
LINE=5,
JUSTIFY=LEFT,
$
TYPE=REPORT,
OBJECT=MENU,
COLOR='WHITE',
HOVER-COLOR=RGB(66 70 73),
BACKCOLOR=RGB(102 102 102),
HOVER-BACKCOLOR=RGB(218 225 232),
BORDER-COLOR='WHITE',
$
TYPE=REPORT,
OBJECT=STATUS-AREA,
COLOR='WHITE',
BACKCOLOR=RGB(102 102 102),
$
TYPE=REPORT,
OBJECT=CURRENT-ROW,
HOVER-BACKCOLOR=RGB(218 225 232),
BACKCOLOR=RGB(200 200 200),
$
TYPE=REPORT,
OBJECT=CALC-AREA,
COLOR='WHITE',
BACKCOLOR=RGB(102 102 102),
$
ENDSTYLE
END


WebFOCUS 7.6.2, MS Windows Server/______, Excel, PDF, HTML
 
Posts: 91 | Registered: May 15, 2008Report This Post
Expert
posted Hide Post
Please put the code between
[code]
your code here
[/code]
tags, otherwise we cannot properly copy/paste the code.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
This snippet may get you a tiny bit closer:

TABLE FILE TEMPCAR1
SUM
COMPUTE OTH_MODEL1/A200V = STRREP (200, OTH_MODEL, 24, MODEL, 0, '', 200, 'A200V'); NOPRINT
LST.OTH_MODEL1 AS OTH_MODEL
BY KEY
ON TABLE HOLD AS TEMPCAR2 FORMAT FOCUS INDEX KEY
END
-RUN


But I see a problem: the output of the second TABLE FILE gives you one row per KEY, which is COUNTRY | CAR. You need the key to include MODEL, since MODEL is in your report and in the heading you want to display all the models except the model that is the sort field value...


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Gold member
posted Hide Post
Thanks guys. Your post really helped. I got it to work. Issue solved.


WebFOCUS 7.6.2, MS Windows Server/______, Excel, PDF, HTML
 
Posts: 91 | Registered: May 15, 2008Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] How to add multiple data from a field to a Header

Copyright © 1996-2020 Information Builders