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
October 30, 2013, 04:46 PM
Waz
The simple answer is use ACROSS instead of BY.
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!
October 30, 2013, 05:07 PM
Francis Mariani
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
October 30, 2013, 05:10 PM
Kevin Patterson
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
October 30, 2013, 05:18 PM
Waz
Try:
TABLE FILE CAR
SUM CAR ACROSS COUNTRY
END
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!
October 30, 2013, 05:32 PM
Kevin Patterson
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
October 30, 2013, 05:38 PM
Francis Mariani
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
October 30, 2013, 06:17 PM
Waz
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.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!
October 31, 2013, 09:08 AM
Kevin Patterson
Wow , 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
October 31, 2013, 04:32 PM
Waz
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.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!
October 31, 2013, 05:03 PM
Kevin Patterson
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