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] Advanced Graph problem

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Advanced Graph problem
 Login/Join
 
Virtuoso
posted
Hello,

I'm having a bit of trouble getting an advanced graph to look a certain way. I've posted about this issue before, but didn't get any useful replies back then, probably because the lack of examples.

The basic issue is that I have - in this case - a number of machines in our factory for which I want to draw graphs of "units produced" per "machine" over time, where time is split in "years" and "months".

I managed to simulate a similar data-set using the finance sample table.
First, let's split the account in two to simulate having separate YEAR and MONTH columns:
DEFINE FILE finance
	DIV/A1 = EDIT(ACCOUNT, '9');
	ACC/A3 = EDIT(ACCOUNT, '$999');
END


Now have a look at this graph:
GRAPH FILE finance
SUM AMOUNT
BY YEAR
BY DIV
BY ACC

ON GRAPH SET LOOKGRAPH VLINE
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB ON
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO ON
ON GRAPH SET GRID ON

ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 1
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 2

ON GRAPH PCHOLD FORMAT PNG

END


As you can see, this produces two graphs. Take note of the horizontal axis, which has a comb-line grouping DIV and ACC together - I want to use that for YEAR and MONTH for our machines.

I'd like to merge the two graphs into one, with a separate graph-line for each year. There can be two years, like in the example, but there can be more - in fact, there will be with the passing of time.

I can also do this:
TABLE FILE finance
SUM AMOUNT
ACROSS YEAR
BY DIV
BY ACC
ON TABLE HOLD FORMAT FOCUS INDEX DIV ACC
END

GRAPH FILE HOLD
SUM AMO1982 AS '1982' AMO1983 AS '1983'
BY DIV
BY ACC

ON GRAPH SET LOOKGRAPH VLINE
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB ON
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO ON
ON GRAPH SET GRID ON

ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 2

ON GRAPH PCHOLD FORMAT PNG

END


This has the desired output, but now my years (machines in my actual situation) are hard-coded! Which means I need to change the graph definition every year (or every time a new machine is added in my actual case).

So... How do I get my graph the way it looks in the second example, but without hard-coding machine names (like in the first example)?

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


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
<FreSte>
posted
Hi Wep,

You can use the FOCUS-hold file for getting the fieldnames (see CHECK FILE ...):

DEFINE FILE FINANCE
	DIV/A1 = EDIT(ACCOUNT, '9');
	ACC/A3 = EDIT(ACCOUNT, '$999');
END


TABLE FILE FINANCE
SUM AMOUNT
ACROSS YEAR
BY DIV
BY ACC
ON TABLE HOLD AS HLD1 FORMAT FOCUS INDEX DIV ACC
END

CHECK FILE HLD1 HOLD AS TMP
TABLE FILE TMP
  PRINT 
    FIELDNAME
  WHERE FIELDNAME CONTAINS 'AMO';
  ON TABLE HOLD AS FLDS FORMAT ALPHA
END
-RUN


GRAPH FILE HLD1
  SUM 
-INCLUDE FLDS
BY DIV
BY ACC

ON GRAPH SET LOOKGRAPH VLINE
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB ON
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO ON
ON GRAPH SET GRID ON

ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 2

ON GRAPH PCHOLD FORMAT PNG

END


-Fred-
 
Report This Post
Virtuoso
posted Hide Post
Thanks a lot, I got it working now.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 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] Advanced Graph problem

Copyright © 1996-2020 Information Builders