Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Multiple graphs on BY field?
Go
New
Search
Notify
Tools
Reply
  
Multiple graphs on BY field?
 Login/Join
 
<kvn>
posted
Is there a way to do this?

I have a hold report with 2 BY fields and a PRINT. I want the first BY field (ACCOUNT) to be a graph and the 2nd BY field (DATE) and PRINT (PCT) axises on that graph.

TABLE FILE TREND
SUM PCT
BY ACCOUNT
BY DATE
ON TABLE HOLD AS ACCTHOLD FORMAT FOCUS
END
 
Reply With QuoteReport This Post
<kvn>
posted
I actually need to make 2 different graphs side by side with the same 2 graphs under for the BY field.

Example

ACCOUNT 1
Graph 1 | Graph 2
--------------------
ACCOUNT 2
Graph 1 | Graph 2
--------------------
ACCOUNT 3
Graph 1 | Graph 2
 
Reply With QuoteReport This Post
Guru
posted Hide Post
Have you tried GRAPH FILE TREND.
Remove the HOLD FORMAT FOCUS.
 
Posts: 346 | Location: Melbourne Australia | Registered: April 15, 2003Reply With QuoteReport This Post
Guru
posted Hide Post
BTW. Using 2 BY fields should give you multiple graphs.
 
Posts: 346 | Location: Melbourne Australia | Registered: April 15, 2003Reply With QuoteReport This Post
<kvn>
posted
I know changing the TABLE to graph will work and using 2 BY fields will give me multiple graphs. I'm using that hold file to graph off of.

I'll try to explain myself better. I just realized I didn't make much sense in my post.

Graph 1
TABLE FILE TREND1
SUM PCTAVG
BY DATE
ON TABLE HOLD AS ACCT1HOLD FORMAT FOCUS
END

Graph 2
TABLE FILE TREND2
SUM PCTTOTAL
BY DATE
ON TABLE HOLD AS ACCT2HOLD FORMAT FOCUS
END

Report
ACCOUNT 1
Graph 1 | Graph 2
--------------------
ACCOUNT 2
Graph 1 | Graph 2
--------------------
ACCOUNT 3
Graph 1 | Graph 2
--------------------
ETC...


So what I need to do is create a report with 2 side-by-side graphs, created from 2 different HOLD files, for each ACCOUNT.
 
Reply With QuoteReport This Post
<Grzegorz>
posted
Below is the example which might be helpful for you. The COUNTRY is used as ACCOUNT, and the CAR as DATE.
It is not the most elegant solution, but it is working at least for the HTML output.

-* First, dump all countries to the temporary table:
TABLE FILE CAR
BY COUNTRY
ON TABLE HOLD AS CTRYHLD FORMAT ALPHA
END
-RUN
-*--------------------------------------------------
-* Read the list of dumped countries:
-SET &CTRYLIST = '';
-SET &CTRYLIST0 = &LINES;
-REPEAT :LISTLOOP FOR &CNT FROM 1 TO &CTRYLIST0;
-READ CTRYHLD &TMPVAR.A10 NOCLOSE
-SET &CTRYLIST.&CNT = &TMPVAR;
-:LISTLOOP
-SET &CTRYLIST = &CTRYLIST1;
-*-------------------------------------------------
-* For each country within the list, create two graphs
-* one for the total, and one for the average.
-* Hold the created graphs as HTML tables.
-REPEAT :HOLDLOOP FOR &CNT FROM 1 TO &CTRYLIST0;
GRAPH FILE CAR
SUM SALES
BY CAR
WHERE COUNTRY EQ '&CTRYLIST.&CNT'
ON TABLE HOLD AS TOTHLD&CNT FORMAT HTMTABLE
END
-RUN
GRAPH FILE CAR
SUM AVE.SALES
BY CAR
WHERE COUNTRY EQ '&CTRYLIST.&CNT'
ON TABLE HOLD AS AVEHLD&CNT FORMAT HTMTABLE
END
-RUN
-:HOLDLOOP
-*-------------------------------------------------
-* Graphs will be displayed on the HTML page:
-HTMLFORM BEGIN

Multiple Graphs


-* For each country display country name,
-* and two graphs for this country:
-REPEAT :HTMLOOP FOR &CNT FROM 1 TO &CTRYLIST0;







-:HTMLOOP
&CTRYLIST.&CNT|
!IBI.FIL.TOTHLD&CNT|;!IBI.FIL.AVEHLD&CNT|;



-HTMLFORM END
Regards
Grzegorz

This message has been edited. Last edited by: <Mabel>,
 
Reply With QuoteReport This Post
<kvn>
posted
Grzegorz your the BEST! Big Grin
 
Reply With QuoteReport This Post
<kvn>
posted
Is there a limit to how many variables you can have in a fex? My graphs are stopping at '!IBI.FIL.TOTHLD100;' using Grzegorz solution.
 
Reply With QuoteReport This Post
<Grzegorz>
posted
I suppose that it is rather a limitation on the size of the generated FOCUS code.

The solution I proposed in previous post is not suitable for the "large number of COUNTRYies in the CAR table".
If you have a large number of ACCOUNTs in the data source, you can try to split the request in order to make it smaller (if possible). For example:

  • Add additional, very selective parameter to the report, representing an "account range".
  • On the launch form ensure that the user can choose only one "account range" at a time.


Such a kind of report is also a good candidate for scheduling (although simply schedule it, does not solve the problem).

Regards
Grzegorz
 
Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Multiple graphs on BY field?

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.