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]Define File for Graph file???

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]Define File for Graph file???
 Login/Join
 
Gold member
posted
Can you put a define file in a graph file. I would like to group values together before graphing them. Please see below, thank you:

 
ENGINE SQLORA SET DEFAULT_CONNECTION EJS
SQL SQLORA PREPARE SQLOUT FOR
SELECT DISTINCT OFFENSE_CODE

FROM
   
END
-*IA_GRAPH_BEGIN
-*Do not delete or modify the comments below
*-INTERNAL_COMMENT LINE#0$PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+DQo8IS0tMS4wLS0+DQo8Um9vdCB2ZXJzaW9uPSIxLjAiPg0KICAgIDxPYmplY3Qgb2JqZWN0SWQ9IkNoYXJ0XzEiPg0KICAgICAgICA8UHJvcGVydHkgbmFtZT0iTGlua2VkU29ydHMiIHR5cGU9ImphdmEubGFuZy5TdHJpbmciLz4NCiAgICA8L09iamVjdD4NCiAgICA8T2JqZWN0IG9iamVjdElkPSJHTE9CQUwiPg0KICAgICAgICA8UHJvcGVydHkgbmFtZT0iU2FtcGxlRGF0YSIgdHlwZT0iamF2YS5sYW5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jRXhoWW1Wc1BTSkhjbTkxY0NBeElpQnpiR2xqWlhKSGNtOTFjRTl5WkdWeVBTSXdJaUJ6YkdsalpYSkhjbTkxY0ZOcGVtVTlJakFpSUhOc2FXTmxja2R5YjNWd2FHbGtaVDBpWm1Gc2MyVWlMejQ4TDFOTVNVTkZVbDlIVWs5VlVEND08L1Byb3BlcnR5Pg0KICAgICAgICA8UHJvcGVydHkgbmFtZT0iZW5hYmxlUHJldmlldyIgdHlwZT0iamF2YS5sYW5nLkJvb2xlYW4iPnRydWU8L1Byb3BlcnR5Pg0KICAgIDwvT2JqZWN0Pg0KPC9Sb290Pg0K
-*Do not delete or modify the comments above
ENGINE INT CACHE SET ON
-DEFAULTH &WF_STYLE_UNITS='PIXELS';
-DEFAULTH &WF_STYLE_HEIGHT='405.0';
-DEFAULTH &WF_STYLE_WIDTH='770.0';
-DEFAULTH &WF_TITLE='WebFOCUS Report';

DEFINE FILE
  JuvSort/A20 = IF OFFENSE_CODE LIKE '111%' OR '36%' OR '40%' THEN 'Sex Offenses' ELSE
  IF OFFENSE_CODE LIKE '531%' OR '539%' THEN 'Disorderly' ELSE
  IF OFFENSE_CODE LIKE '29%'  THEN 'Vandalism' ELSE
  IF OFFENSE_CODE LIKE '12%'  THEN 'Robery' ELSE
  IF OFFENSE_CODE LIKE '52%'  THEN 'Weapons Offense' ELSE
  IF OFFENSE_CODE LIKE '22%'  THEN 'Burglary' ELSE
  IF OFFENSE_CODE LIKE '1312%' OR '1313%' OR '1316%' OR '1399%' THEN 'Sex Offenses' ELSE
  IF OFFENSE_CODE LIKE '41%'  THEN 'Alchohol Violation' ELSE
  IF OFFENSE_CODE LIKE '35%' THEN 'Drug Offenses' ELSE
  IF OFFENSE_CODE LIKE '23%'  THEN 'Larceny' ELSE
  IF OFFENSE_CODE LIKE '130%' OR '1314%' OR '1315%' THEN 'Aggravated Assault' ELSE
  IF OFFENSE_CODE LIKE '24%'  THEN 'Motor Vehicle Theft' ELSE
  IF OFFENSE_CODE LIKE '902%' THEN 'Juvenile Offenses' ELSE
  IF OFFENSE_CODE LIKE '9099%' THEN 'Other' ELSE
  IF OFFENSE_CODE LIKE '25%' OR '26%'  THEN 'Forgery/Fraud' ELSE
  IF OFFENSE_CODE LIKE '11%'  THEN 'Rape' ELSE
  IF OFFENSE_CODE LIKE '0%' THEN 'Homicide' ELSE
  IF OFFENSE_CODE LIKE '54%' THEN 'Criminal Traffic Offenses';
END

GRAPH FILE SQLOUT
-* Created by Info Assist for Graph
SUM CNT.SQLOUT.SQLOUT.JuvSort AS 'OFFENSES'
BY SQLOUT.SQLOUT.JuvSort AS 'Offenses'
HEADING
"Crime Analysis"
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET UNITS &WF_STYLE_UNITS
ON GRAPH SET HAXIS &WF_STYLE_WIDTH
ON GRAPH SET VAXIS &WF_STYLE_HEIGHT
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 0
ON GRAPH SET LOOKGRAPH PIEMULTI
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);
setPieFeelerTextDisplay(1);
*END
INCLUDE=endeflt.sty,$
TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, $
TYPE=HEADING, JUSTIFY=CENTER, FONT='Trebuchet MS', SIZE=18, COLOR=RGB(66 70 73), STYLE=BOLD, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
setPieSliceDetach(getSeries(*), 75);
setPieSliceDetach(getSeries(*), 75);
setPieSliceDetach(getSeries(*), 75);
setPieSliceDetach(getSeries(*), 75);
setPieSliceDetach(getSeries(*), 75);
setPieSliceDetach(getSeries(*), 75);
setPieSliceDetach(getSeries(*), 75);
setPieSliceDetach(getSeries(*), 75);
setPieSliceDetach(getSeries(*), 75);
setPieSliceDetach(getSeries(*), 75);
*END
ENDSTYLE
END
-RUN

-*IA_GRAPH_FINISH
 

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


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 96 | Registered: October 13, 2014Report This Post
Virtuoso
posted Hide Post
Yes you can, the "DEFINE FILE abc" must refer to the same file name as the "GRAPH FILE abc" does.

The GUI does it for you.
This is still basics.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Expert
posted Hide Post
The question here is can you do it with SQLOUT.

Quicklearner, have you tried it to see if it works ?


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
Master
posted Hide Post
If I understand your requirements, correctly, you need to:
1. Extract data from a relational table(s) using SQL passthru.
2. Summarize/sort/calculate a dimension in WebFOCUS.
3. Create a pie chart from the summarized data.

The following focexec...
-* File QuickLearner.fex
-*
-* Extract data from relational tables.  
-*
ENGINE SQLMSS SET DEFAULT_CONNECTION CON01
SQL SQLMSS PREPARE SQLOUT FOR
 SELECT  
       [BusinessEntityID]
      ,[Title]
      ,[FirstName]
      ,[MiddleName]
      ,[LastName]      
      ,[CountryRegionName]
      ,[SalesYTD]
      ,[SalesLastYear]
 FROM [AdventureWorks2014].[Sales].[vSalesPerson];
END
-*
TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS HLDEXT
END
-RUN
-*
-* Summarize and calculate dimension.  
-*
DEFINE FILE HLDEXT
 DIMENSION/A20 = DECODE CountryRegionName ('United States'  'Baseball'
                                           'Canada'         'Hockey'
					   'Germany'        'Fencing'
					   'Australia'      'Rugby'
					   'United Kingdom' 'Cricket'
					   'France'         'Tennis');
END
-*
TABLE FILE HLDEXT
SUM   SalesYTD/P21.2 
BY    DIMENSION
ON TABLE HOLD AS HLDSUM
END
-RUN
-*
-* Create visualization.  
-*
ENGINE INT CACHE SET ON
-*
GRAPH FILE HLDSUM
SUM SalesYTD  AS 'Sales per Sport'
BY  DIMENSION
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH PIEMULTI
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0); 
setCurveFitEquationDisplay(false); 
setPlace(true); 
setPieFeelerTextDisplay(1); 
*END
INCLUDE=endeflt.sty,$
TYPE=REPORT, TITLETEXT='WebFOCUS Report', $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
*END
ENDSTYLE
END   

Creates the following visualization:

Please Note:
* I am using the MS SQL Server sample database - AdventureWorks2014
* You might want to think about creating metadata for your Oracle table. That way you could use the TABLE FILE command to pull data from the table. There would be other advantages to doing this, which you'll probably see in other posts.
* Generally you want to push summing and sorting up to the relational databases, but for your case, this doesn't seem to be an issue.
* Many of our requests are for a graph and a grid of the same data, side by side. In the above example the HLDSUM file could be used in a TABLE FILE and a GRAPH FILE.

Always glad to help out our friends in Law Enforcement! Thank you for your service to your community.

This message has been edited. Last edited by: David Briars,
 
Posts: 822 | Registered: April 23, 2003Report This Post
Gold member
posted Hide Post
Perfect!! Thank you for all you guess help!!! This was well appreciated!!!


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 96 | Registered: October 13, 2014Report This Post
Gold member
posted Hide Post
Can you do "smart positioning" and "on slice" for labelling a pie graph. The user wants both the name to describe the slice on the slice and smart positioned.


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 96 | Registered: October 13, 2014Report 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]Define File for Graph file???

Copyright © 1996-2020 Information Builders