Focal Point
[CLOSED] Display the first column depending on a BY field

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1607011036

April 11, 2013, 12:30 PM
prodrigu
[CLOSED] Display the first column depending on a BY field
This might sound simple but for some reason I am getting stumped by it. I am trying to display the first column (country) depending if the second column (car) changes. Can someone please help me or point me in the right direction.

TABLE FILE CAR
PRINT 
SEATS
DEALER_COST
RETAIL_COST
BY COUNTRY 
BY CAR 
BY BODYTYPE 
END
-EXIT  


This is what I am getting in the first picture and in the second picture is what i want.

This message has been edited. Last edited by: <Kathryn Henning>,


Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats
April 11, 2013, 01:34 PM
FrankDutch
Should be something like this


Print whatever
By country noprint
By car
By country

Now you have the car and country in the wrong columns but there is a setting to switch them.
I do not know that by head, but there will be anybody who does.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

April 11, 2013, 02:00 PM
Microfich
quote:
TABLE FILE CAR
PRINT
SEATS
DEALER_COST
RETAIL_COST
BY COUNTRY
BY CAR
BY BODYTYPE
END
-EXIT


One way to do it:

 
TABLE FILE CAR
PRINT 
SEATS
DEALER_COST
RETAIL_COST
BY COUNTRY 
BY CAR 
BY BODYTYPE 
ON TABLE HOLD
END
-RUN
DEFINE FILE HOLD
NEWCONT/A10 = IF CAR EQ LAST CAR THEN '' ELSE COUNTRY;
NEWCAR/A16  = IF CAR EQ LAST CAR THEN '' ELSE CAR;
END
TABLE FILE HOLD
PRINT 
NEWCONT AS COUNTRY
NEWCAR AS CAR
BODYTYPE
SEATS DEALER_COST RETAIL_COST
BY COUNTRY NOPRINT
BY CAR NOPRINT
BY BODYTYPE NOPRINT
END
-RUN
 



WebFOCUS 8105
Windows;
DB2, UDB, SQL Server, Oracle
FOCUS-WebFOCUS since 1981
April 11, 2013, 03:35 PM
Mighty Max
Frank was talking about SEQUENCE. I forget about it myself because I hardly have the need to use it.

TABLE FILE CAR
PRINT 
   SEATS
   DEALER_COST
   RETAIL_COST
BY COUNTRY NOPRINT 
BY CAR
BY COUNTRY 
BY BODYTYPE
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,PAGESIZE='Letter',LEFTMARGIN=0.250000,RIGHTMARGIN=0.250000,TOPMARGIN=0.250000,BOTTOMMARGIN=0.250000,SQUEEZE=ON,ORIENTATION=LANDSCAPE,$
TYPE=REPORT,FONT='ARIAL',SIZE=8,COLOR='BLACK',STYLE=NORMAL,LEFTGAP=0.05,RIGHTGAP=0.05,BORDER=LIGHT,$
TYPE=REPORT,COLUMN=N3,SEQUENCE=1,$
ENDSTYLE
END
-RUN  



WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
April 12, 2013, 06:55 AM
Jeff_f
I would go with:
 DEFINE FILE CAR
COUNTRY_CAR/A26 = COUNTRY || CAR;
END
TABLE FILE CAR
PRINT 
SEATS
DEALER_COST
RETAIL_COST
BY COUNTRY_CAR NOPRINT
BY COUNTRY 
BY CAR 
BY BODYTYPE 
END 

April 12, 2013, 02:25 PM
Doug
quote:
but there is a setting to switch them.

Consider the use of SEQUENCE to place the display fields in the desired order.




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
April 16, 2013, 07:29 AM
Alex
Borrowed from Doug with a minor modification:

TABLE FILE CAR
PRINT DEALER_COST
BY COUNTRY NOPRINT 
BY CAR
BY COUNTRY
ON TABLE SET STYLE *
TYPE=REPORT, COLUMN=COUNTRY,SEQUENCE=1, $
TYPE=REPORT, COLUMN=CAR,    SEQUENCE=2, $
ENDSTYLE
END



WF 7.7.04, WF 8.0.7, Win7, Win8, Linux, UNIX, Excel, PDF