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] ACROSS Question

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] ACROSS Question
 Login/Join
 
Platinum Member
posted
I'm having problems getting the "BY" column header to appear on the same line as the "ACROSS" column header values. I need them on the same line so that I my customers can use Auto Filter and sort in Excel.

My code:
TABLE FILE SF86REVIEW2
SUM
ROWTOT AS 'ROWTOT'

BY CLR_ACR_ID AS 'CLR/ACR #'
ACROSS SF86REVIEW2.REJECTER AS ''

WHERE SF86REVIEW2.DAYSRJCT LE 10

ON TABLE PCHOLD FORMAT EXL2K OPEN
END



Gives me:
             AcrossHeader1     AcrossHeader2     AcrossHeader3
ByHeader
Value1             1                 2                 3


What I need:
ByHeader     AcrossHeader1     AcrossHeader2     AcrossHeader3
Value1             1                 2                 3

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


Production - 7.6.4
Sandbox - 7.6.4
 
Posts: 241 | Location: Bethesda, MD | Registered: August 14, 2007Report This Post
Expert
posted Hide Post
This is normal WebFOCUS behaviour.

If you really need to get the column titles in one row, you could use a McGyver technique, though the code isn't pretty:

-SET &ECHO = 'ALL';

SET ASNAMES=ON
SET HOLDFORMAT=ALPHA
SET HOLDLIST=PRINTONLY
SET PAGE=NOLEAD
-RUN

TABLE FILE CAR
SUM SALES
BY COUNTRY
ACROSS SEATS AS ''
ON TABLE HOLD AS H001
END
-RUN

?FF H001
-RUN

-*-- Create a hold file containing the column names and other attributes of the hold file
CHECK FILE H001 HOLD
-RUN

-*-- Create a hold file containing only the column names generated by the across statement
TABLE FILE HOLD
PRINT FIELDNAME
WHERE FIELDNAME NE 'COUNTRY'
ON TABLE HOLD AS H002
END
-RUN

-*-- Create the report
TABLE FILE H001
PRINT
COUNTRY

-*-- Read the across column name
-READ H002 &FIELDNAME.A66.
-REPEAT END_REP1 WHILE &IORETURN EQ 0;
-*-- Extract the across column value
-SET &FIELDVALUE = SUBSTR(66, &FIELDNAME, 4, 5, 1, 'A1');

-*-- display the across column name and value
&FIELDNAME AS '&FIELDVALUE'

-READ H002 &FIELDNAME.A66.

-END_REP1
END
-RUN


?FF shows what the across column names evaluate to, (in my example SAL1, SAL2, etc) this information is used in the SUBSTR function which extracts the value of the ACROSS field.


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
Platinum Member
posted Hide Post
Is there a way, using the original code I posted, to apply formatting (bold, underline, color, font, etc) to the across column headers?


Production - 7.6.4
Sandbox - 7.6.4
 
Posts: 241 | Location: Bethesda, MD | Registered: August 14, 2007Report This Post
Expert
posted Hide Post
TABLE FILE CAR
SUM
SALES AS 'ROWTOT'

BY COUNTRY AS 'CLR/ACR #'
ACROSS SEATS AS ''

-*ON TABLE PCHOLD FORMAT EXL2K

ON TABLE SET STYLE *
TYPE=TITLE, STYLE=BOLD, $
TYPE=ACROSSVALUE, STYLE=BOLD, $
ENDSTYLE
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
<JG>
posted
The best way to achieve what you want for filtering is by using a template/macro to
move the BY title up 1 row and then delete the blank row that is left.

You can then turn on the auto filtering at the same time.
 
Report This Post
Platinum Member
posted Hide Post
This is the solution that we came up with:

TABLE FILE SF86REVIEW2
SUM
ROWTOT AS ''
 
BY CLR_ACR_ID

ACROSS SF86REVIEW2.REJECTER
ACROSS-TOTAL AS 'TOTAL'


WHERE SF86REVIEW2.DAYSRJCT LE 60

ON TABLE SET ASNAMES ON
ON TABLE HOLD
END

TABLE FILE HOLD
PRINT *

ON TABLE SET STYLE *
ORIENTATION=LANDSCAPE,$
TYPE=TITLE, COLOR=NAVY, STYLE=BOLD+UNDERLINE, FONT=ARIAL, SIZE=10,$
TYPE=ACROSSVALUE, COLOR=NAVY, STYLE=BOLD+UNDERLINE, FONT=ARIAL, SIZE=10,$
ENDSTYLE

ON TABLE PCHOLD FORMAT EXL2K
END


This gave me all of the column headers on the same row, with the same formatting.


Production - 7.6.4
Sandbox - 7.6.4
 
Posts: 241 | Location: Bethesda, MD | Registered: August 14, 2007Report 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] ACROSS Question

Copyright © 1996-2020 Information Builders