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
October 26, 2004, 10:07 PM
<kvn>
I actually need to make 2 different graphs side by side with the same 2 graphs under for the BY field.
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.
October 27, 2004, 12:35 PM
<Grzegorz>
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;
&CTRYLIST.&CNT|
!IBI.FIL.TOTHLD&CNT|;
!IBI.FIL.AVEHLD&CNT|;
-:HTMLOOP
-HTMLFORM END Regards GrzegorzThis message has been edited. Last edited by: <Mabel>,
October 27, 2004, 01:22 PM
<kvn>
Grzegorz your the BEST!
October 27, 2004, 04:43 PM
<kvn>
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.
October 28, 2004, 02:03 PM
<Grzegorz>
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).