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]make multiple ACROSS FILEDS display horizontal~

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]make multiple ACROSS FILEDS display horizontal~
 Login/Join
 
Member
posted
hi all,
 
table file file1
   sum   
        emp_count
   by org_name
   across emp_type
   across sex
   across age_group
end 

 

i have one report like this, need to display the across fileds "sex" and "age_group" horizontal,just like this.
how can i make it out?
thanks very much for reply!

----------------------emp_type1------------| emp_type2 ----------|
-----------------sex-----------|age_group|--------sex----|age_group |
----------------male|female|<=30| >30|male|female|<=30|>30 |
company 1 --120-|-80---| 110|90 |110 |90 |100 |100 |
company 2 --130 |-90---| 120|100 |110 |90 |100 |100 |

This message has been edited. Last edited by: swell.wang,


webfocus 7.65
windows xp sp3
excel,html ,pdf,and graph
 
Posts: 20 | Registered: January 26, 2010Report This Post
Expert
posted Hide Post
Please always put your code and report between
[code]
[/code]
tags, like this:

[code]
TABLE FILE FILE1
SUM
EMP_COUNT
BY ORG_NAME
ACROSS EMP_TYPE
ACROSS SEX
ACROSS AGE_GROUP
END
[/code]


The </> button on the message toolbar is a handy way of adding the tags.

I can't think of an easy way to solve this problem - I hope someone more creative than me answers this question.


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
See if you can make sense of the following code, it produces what you're looking for.

-SET &ECHO=ALL;

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

-* Create demo data

DEFINE FILE EMPLOYEE
BIRTHDAY/YYMD = HIRE_DATE;
SEX/A10 = IF SALARY LT 15000 THEN 'Male' ELSE 'Female';
COMPANY/A30 = JOB_DESC;
EMP_COUNT/P9 = 1;
EMP_TYPE/A1 = SUBSTR(3, JOBCODE, 1, 1, 1, 'A1');
AGE/I4 = DATEDIF(BIRTHDAY, '&YYMD.EVAL', 'Y');
AGE_GROUP/A4 = IF AGE LE 30 THEN '<=30' ELSE '>30';
END

TABLE FILE EMPLOYEE
PRINT
BIRTHDAY
SEX
COMPANY
EMP_COUNT
JOBCODE
EMP_TYPE
AGE
AGE_GROUP
ON TABLE HOLD AS DEMODATA
END
-RUN

-* Prepare data - part 1

DEFINE FILE DEMODATA
SEX_AGE/A10 = SEX;
SEX_AGE_SORT/A2 = IF SEX EQ 'Female' THEN '11' ELSE '10';
END

TABLE FILE DEMODATA
SUM
EMP_COUNT
BY COMPANY
BY SEX_AGE
BY SEX_AGE_SORT
BY EMP_TYPE
ON TABLE HOLD AS H1
END
-RUN

-* Prepare data - part 1

DEFINE FILE DEMODATA
SEX_AGE/A10 = AGE_GROUP;
SEX_AGE_SORT/A2 = IF AGE_GROUP EQ '>30' THEN '21' ELSE '20';
END

TABLE FILE DEMODATA
SUM
EMP_COUNT
BY COMPANY
BY SEX_AGE
BY SEX_AGE_SORT
BY EMP_TYPE
ON TABLE HOLD AS H2
END

TABLE FILE H1
SUM
EMP_COUNT
ACROSS EMP_TYPE
ACROSS SEX_AGE_SORT NOPRINT
ACROSS SEX_AGE AS ''
BY COMPANY

ON TABLE SET PAGE NOLEAD
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=REPORT, SQUEEZE=ON,
FONT='ARIAL', SIZE=8,
BORDER=1, BORDER-COLOR=SILVER,
$
ENDSTYLE

MORE
FILE H2
END
-RUN


Report:

                                 EMP_TYPE
                                         A                                               B
                                  
                                 Male        Female      <=30        >30         Male        Female      <=30
 COMPANY
 --------------------------------------------------------------------------------------------------------------------
 ASSIST.MANAGER                          .           1           1           .           .           .           .
 DEPARTMENT MANAGER                      .           2           2           .           .           .           .
 FILE QUALITY                            .           .           .           .           1           .           1
 MANAGER                                 .           1           1           .           .           .           .
 PRODUCTION CLERK                        1           .           1           .           .           .           .
 PROGRAMMER                              .           .           .           .           .           4           4
 PROGRAMMER ANALYST                      .           .           .           .           .           1           1
 PROGRAMMER TRAINEE                      .           .           .           .           2           .           2
 SECRETARY                               3           .           1           2           .           .           .
 SUPERVISOR/PRODUCTION                   .           1           1           .           .           .           .
 SYSTEMS ANALYST                         .           .           .           .           .           2           2



You will have to code your own column titles using HEADING (you will find discussions of this in FocalPoint).

Good luck.


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
If you need to make sure certain across values exist, then you can use the COLUMNS option.

TABLE FILE CAR
SUM SALES
ACROSS COUNTRY
ACROSS SEATS COLUMNS 2 AND 3 AND 4 AND 5 AND 20
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
Member
posted Hide Post
to Francis,
thank you very much~that can work for me~


webfocus 7.65
windows xp sp3
excel,html ,pdf,and graph
 
Posts: 20 | Registered: January 26, 2010Report 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]make multiple ACROSS FILEDS display horizontal~

Copyright © 1996-2020 Information Builders