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     Line graph lines on By field

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Line graph lines on By field
 Login/Join
 
<kvn>
posted
Is there a way to setup a line graph to graph separate lines on a single By field. I know I can get multiple lines using multiple By fields but I wants the fields within the By fields to be the lines in the graph. Using 2 other fields for the X & Y axis. X would be months and Y would be the scores.

ie. Data

Name Score Month
Harry 90 Jan
Harry 96 Feb
Harry 92 Mar
Megan 98 Jan
Megan 96 Feb
Megan 97 Mar
Sarah 83 Jan
Sarah 89 Feb
Sarah 92 Mar
Sarah 95 Apr
...
 
Report This Post
Guru
posted Hide Post
I think I understood what you were asking for.

DEFINE FILE GRAPHDAT
HARRY/I2=
IF NAME EQ 'Harry' THEN GRADE ELSE 0;
MEGAN/I2 =
IF NAME EQ 'Megan' THEN GRADE ELSE 0;
SARAH/I2 =
IF NAME EQ 'Sarah' THEN GRADE ELSE 0;
END
GRAPH FILE GRAPHDAT
SUM HARRY MEGAN SARAH
ACROSS MTH
ON GRAPH SET LOOKGRAPH VLINE
...


Did I understand you correctly?
 
Posts: 346 | Location: Melbourne Australia | Registered: April 15, 2003Report This Post
<kvn>
posted
It looks like you did understand but I can't hard code anything into a Define like you are doing. It has to be dynamic because the number of people can vary.
 
Report This Post
<Grzegorz>
posted
It looks that you need something like "Turning the data values into the data structure" and then GRAPH from the created data structure. One of the way to do this is to use ACROSS. For example:

-* First dump and get the names of the regions as the list.
-* The names of the regions will be used as the labels
-* for the chart lines.
TABLE FILE CENTORD
BY REGION
-* A reasonable WHERE condition is needed here
-* to limit the number of lines in the chart.
-* If the chart contains 1024 lines, the user will see nothing.
-* (unless it is Visual Discovery).
ON TABLE HOLD FORMAT ALPHA
END
-RUN
-SET &LABELS0 = &LINES;
-REPEAT :LOOP FOR &CNT FROM 1 TO &LABELS0;
-READ HOLD &LABELS.&CNT.A5 NOCLOSE
-:LOOP
-CLOSE HOLD
-*---------------------------------------------------------
-* Prepare the data for the graph:
TABLE FILE CENTORD
SUM LINEPRICE
ACROSS REGION
BY MONTH
-* The same WHERE as in the first TABLE request.
ON TABLE HOLD AS CENTHLD
END
-*---------------------------------------------------------
-* Display the graph:
GRAPH FILE CENTHLD
SUM
-* Fields are named as E01, E02, ..., E16, etc.
-* E01 field is MONTH, all the rest are the line values.
-* Each across field becomes the line in the chart:
-REPEAT :LOOP2 FOR &CNT FROM 1 TO &LABELS0;
-SET &TMP = &CNT + 1;
-SET &SUFFIX = IF &TMP LE 9 THEN '0' || '&TMP.EVAL' ELSE '&TMP.EVAL';
E&SUFFIX AS '&LABELS.&CNT'
-:LOOP2
BY MONTH
ON GRAPH SET LOOKGRAPH VLINE
ON GRAPH SET 3D OFF
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET GRAPHSTYLE *
setLegendOrient(0);
setLegendAutomatic(true);
setLegendPosition(2);
ENDSTYLE
END

It is possible to "generalize and externalize" the code for "turning data into structure", create library focexecs, and use it for the number of reports (-INCLUDE).

Hope this helps
Grzegorz
 
Report 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     Line graph lines on By field

Copyright © 1996-2020 Information Builders