Focal Point
[CLOSED] More control over BYDISPLAY

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

December 19, 2017, 12:32 PM
MichaelSamuels
[CLOSED] More control over BYDISPLAY
I have a report requirement that I can describe using the CAR table as an example.

I want to do:

  
PRINT SEATS
BY COUNTRY
BY CAR
BY MODEL
ACROSS BODYTYPE
END


But I want to show the Country every time it or the Car changes.

This message has been edited. Last edited by: FP Mod Chuck,


7706 gen 902; Windows 10
December 19, 2017, 12:54 PM
MichaelSamuels
For more clarification ...
Here's what it gives me now:


And here's what I want:

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


7706 gen 902; Windows 10
December 19, 2017, 01:11 PM
Doug
Welcome to the forum...

Check out the BYDISPLAY command.
ON : Shows all BY fields.
Off: Does not show all BY fields.

I hope this helps.

BTW: Please use the red < / > tags, upper right of this pop-up, to display your code.




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
December 19, 2017, 01:27 PM
Francis Mariani
Michael, I don't see the images you posted - I don't think we can see http://content.fulcircle.com/F...BYDISPLAY_before.png


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
December 19, 2017, 01:55 PM
MichaelSamuels
Please try it now. I've changed the URL.


7706 gen 902; Windows 10
December 19, 2017, 02:00 PM
MichaelSamuels
Doug,

With BYDISPLAY=OFF, it shows the COUNTRY, CAR, and MODEL data only when the corresponding data changes.

With BYDISPLAY=ON, it shows all data on every line.

What I'm looking for is different. I want it to be just like BYDISPLAY=OFF, except that I want COUNTRY data to show when either the COUNTRY data changes or the CAR data changes.


7706 gen 902; Windows 10
December 19, 2017, 03:10 PM
Waz
I think its Define Time...


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!

December 19, 2017, 04:22 PM
Doug
quote:
I think its Define Time...
Me too...
December 19, 2017, 10:09 PM
Pku
Michael,

Try this,
TABLE FILE CAR
PRINT SEATS
BY COUNTRY
BY CAR
BY MODEL
ACROSS BODYTYPE
ON TABLE HOLD AS HCAR
END
?FF HCAR
TABLE FILE HCAR
PRINT 
COMPUTE N_COUNTRY/A20 = IF CAR EQ LAST CAR THEN '' ELSE COUNTRY; AS 'COUNTRY'
COMPUTE N_CAR/A16     = IF CAR EQ LAST CAR THEN '' ELSE CAR;     AS 'CAR'
MODEL
E04 AS 'CONVERTIBLE'
E05 AS 'COUPLE'
E06 AS 'HARDTOP'
E07 AS 'ROADSTER'
E08 AS 'SEDAN'
END  



Thanks,
Pku

Focus, WebFocus 8201 on Windows
December 20, 2017, 08:20 AM
dbeagan
Does something like this work for you?
 DEFINE FILE CAR
 COUNTRYCAR/A26 = COUNTRY | CAR;
 END

 TABLE FILE CAR
    SUM SEATS
     BY COUNTRYCAR NOPRINT
     BY COUNTRY
     BY CAR
     BY MODEL
 ACROSS BODYTYPE
 END



WebFOCUS 8.2.06
December 20, 2017, 08:43 AM
MartinY
Different technique where you don't have to care about the ACROSS alias and value (E04, E05, ...) which you may not know and may change depending on the number of ACROSSed value in the Hold file (reason why Pku have used the &FF HCAR to know how many have been hold).

DEFINE FILE CAR
CNTRYID/I2  = IF CAR EQ LAST CAR THEN CNTRYID  ELSE CNTRYID + 1;
N_CNTRY/A20 = IF CAR EQ LAST CAR THEN ''       ELSE COUNTRY;
CARID  /I2  = IF CAR EQ LAST CAR THEN CARID    ELSE CARID + 1;
N_CAR  /A16 = IF CAR EQ LAST CAR THEN ''       ELSE CAR;
END
TABLE FILE CAR
SUM SEATS

BY COUNTRY NOPRINT
BY CNTRYID NOPRINT
BY HIGHEST N_CNTRY AS 'COUNTRY'
BY CARID   NOPRINT
BY HIGHEST N_CAR   AS 'CAR'
BY MODEL
ACROSS BODYTYPE AS ''
END
-RUN



WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
December 20, 2017, 10:08 AM
j.gross
Or simply

. . .
BY COUNTRY NOPRINT
BY CAR NOPRINT
BY COUNTRY
BY CAR
BY MODEL
. . .

Whenever a sort (BY) object has a sort-break, so do all the lower-level sort objects. So if our #1 or #2 (COUNTRY, CAR) changes, #3 through #5 will be displayed.

There is no need to keep the sort object names distinct, and thus no need for Define -- unless you want to reference the second COUNTRY or CAR columns by name in ON phrases or in STYLE.


- Jack Gross
WF through 8.1.05
December 20, 2017, 03:31 PM
Waz
quote:
Or simply

. . .
BY COUNTRY NOPRINT
BY CAR NOPRINT
BY COUNTRY
BY CAR
BY MODEL
. . .


Good One


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!

December 20, 2017, 04:21 PM
MichaelSamuels
Jack Gross,
Good one, indeed!

Doug, in a previous post, says, "Whatever they want. Heck Yeah, We can do that in WebFOCUS! "
I started working with WebFocus about 4 years ago. As a "novice", I was often dismayed by its complexity. About 3 months ago, I graduated to "beginner" by creating several very complex reports. It's then that I started believing Doug's adage.
This report was the most complex yet. And I really got stumped with the problem I described in this thread. Now, even more, I believe what Doug says.
Not only that ...
I really appreciate this forum.


7706 gen 902; Windows 10
December 20, 2017, 04:43 PM
David Briars
quote:
...I started working with WebFocus about 4 years ago. As a "novice", I was often dismayed by its complexity. About 3 months ago, I graduated to "beginner" by creating several very complex reports. It's then that I started believing Doug's adage...

+1
December 22, 2017, 08:19 AM
dbeagan
j.gross very nice.


WebFOCUS 8.2.06