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     Display Fields Horizontally [SOLVED]

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Display Fields Horizontally [SOLVED]
 Login/Join
 
Gold member
posted
I've seen a number of issues where people ask to display information horizontally, but the answers don't seem to do what I think the poster is asking. I can't find much relief in the help documentation either.

I am trying to do something as simple as print all the distinct cars out horizontally. So that my results will look like:
CAR JAGUAR JENSEN TRIUMPH DATSUN TOYOTA ALFA ROMEO

Rather that the normal output of:
CAR
JAGUAR
JENSEN
TRIUMPH
DATSUN
TOYOTA
ALFA ROMEO

Thanks for any help you can offer.

This message has been edited. Last edited by: Kevin Patterson,


Kevin Patterson
Appalachian State University
WebFOCUS 7.7.03
Windows, All Outputs
 
Posts: 57 | Registered: February 29, 2012Report This Post
Expert
posted Hide Post
The simple answer is use ACROSS instead of BY.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs: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, 2006Report This Post
Expert
posted Hide Post
Or this way:
TABLE FILE CAR
SUM
CAR
BY CAR NOPRINT
ON TABLE HOLD AS HCAR FORMAT ALPHA
END

DEFINE FILE HCAR
ALL_CAR/A200V = ALL_CAR || (' ' | CAR);
END

TABLE FILE HCAR
SUM
MAX.ALL_CAR
END

The first TABLE FILE is not required - it's to ensure the data is in the correct order for the DEFINE and (I think) to ensure there are unique data values.


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 Waz, I'm still confused though.
Do you mean something like:
TABLE FILE CAR
PRINT CAR ACROSS COUNTRY
END

That gives me a matrix. I just want one line of output. So now that we have country in there, Really what I'd like to do is to show something like all the cars in a country:

ITALY ALFA ROMEO MASERATI
W GERMANY AUDI BMW
JAPAN DATSUN TOYOTA
ENGLAND JANGUAR JENSEN TRIUMPH
FRANCE PEUGEOT


Kevin Patterson
Appalachian State University
WebFOCUS 7.7.03
Windows, All Outputs
 
Posts: 57 | Registered: February 29, 2012Report This Post
Expert
posted Hide Post
Try:
TABLE FILE CAR
SUM CAR ACROSS COUNTRY
END


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs: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, 2006Report This Post
Gold member
posted Hide Post
Riffing off of both of your posts I came up with (data isn't quite correct but it gives me the output I want):

TABLE FILE CAR
PRINT
COUNTRY
CAR
BY COUNTRY NOPRINT
ON TABLE HOLD AS HCAR FORMAT ALPHA
END

TABLE FILE HCAR
SUM
COMPUTE ALL_CAR/A200V = ALL_CAR || (' ' | CAR);
BY COUNTRY
END

To show this:
COUNTRY ALL_CAR
ENGLAND TRIUMPH
FRANCE TRIUMPH PEUGEOT
ITALY TRIUMPH PEUGEOT MASERATI
JAPAN TRIUMPH PEUGEOT MASERATI TOYOTA
W GERMANY TRIUMPH PEUGEOT MASERATI TOYOTA BMW


Is there a way to clear out that compute on each iteration it goes through.


Kevin Patterson
Appalachian State University
WebFOCUS 7.7.03
Windows, All Outputs
 
Posts: 57 | Registered: February 29, 2012Report This Post
Expert
posted Hide Post
It should be done in the DEFINE

SET ASNAMES=ON
SET HOLDFORMAT=ALPHA
SET HOLDLIST=PRINTONLY

TABLE FILE CAR
PRINT
COUNTRY
CAR
BY COUNTRY NOPRINT
BY CAR NOPRINT
ON TABLE HOLD AS HCAR FORMAT ALPHA
END

DEFINE FILE HCAR
ALL_CAR/A200V = IF COUNTRY NE LAST COUNTRY THEN CAR ELSE ALL_CAR || (' ' | CAR);
END

TABLE FILE HCAR
SUM
MAX.ALL_CAR
BY COUNTRY
END


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
And if you want to minimise hold files:
SET ASNAMES=ON
SET HOLDFORMAT=ALPHA
SET HOLDLIST=PRINTONLY

TABLE FILE CAR
SUM COMPUTE CAR_CNT/I9 = CNT.CAR ; NOPRINT
BY COUNTRY
PRINT COMPUTE ALL_CAR/A200V = IF COUNTRY NE LAST COUNTRY THEN CAR ELSE ALL_CAR || (' ' | CAR);
COMPUTE CNTR/I9 = IF COUNTRY EQ LAST COUNTRY THEN LAST CNTR  + 1 ELSE 1 ; NOPRINT
BY COUNTRY
WHERE TOTAL CAR_CNT EQ CNTR
END


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs: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, 2006Report This Post
Gold member
posted Hide Post
Wow Eeker , that is really awesome! Thank you guys; this is exactly what I was looking for.


Kevin Patterson
Appalachian State University
WebFOCUS 7.7.03
Windows, All Outputs
 
Posts: 57 | Registered: February 29, 2012Report This Post
Expert
posted Hide Post
The important thing is to understand the techniques, why certain things are done and for what reason.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs: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, 2006Report This Post
Gold member
posted Hide Post
Definitely. I hadn't run across the LAST command, which I see I can use to figure out when to concatenate the field to the previous information or start over with the current value. Thanks again.


Kevin Patterson
Appalachian State University
WebFOCUS 7.7.03
Windows, All Outputs
 
Posts: 57 | Registered: February 29, 2012Report 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     Display Fields Horizontally [SOLVED]

Copyright © 1996-2020 Information Builders