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] Displaying a graphical representation of joins

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Displaying a graphical representation of joins
 Login/Join
 
Member
posted
Hello everyone,
I am looking for a way to graphically display table joins. I know it is possible to use CHECK FILE filename PICTURE and the display is alright but is not very appealing to look at. I am looking for a display that is similar to Join Editor which is a much better graphical representation of table joins. Does anyone know how this can be done or am I hoping for too much?

This message has been edited. Last edited by: FP Mod Chuck,
 
Posts: 10 | Registered: June 19, 2018Report This Post
Master
posted Hide Post
What environment? AppStudio? DevStudio? InfoAssist?

Where are the joins? MasterFile? Report? Chart?


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Report This Post
Member
posted Hide Post
Hallway,
I'm using 8202M Text Editor and the joins were created as synonyms on MasterFiles to create Clusters.
 
Posts: 10 | Registered: June 19, 2018Report This Post
Master
posted Hide Post
Can you open the masterfile in AppStudio (not just text editor)? If so, then just click on the Modeling View tab at the bottom and you will have a GUI representation of the joins


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Report This Post
Member
posted Hide Post
I don't have AppStudio and that is why I was curios if there was a way to display the nice GUI representation that AppStudio has just using the Text Editor
 
Posts: 10 | Registered: June 19, 2018Report This Post
Virtuoso
posted Hide Post
You can get (most of) the JOIN details from TABLE FILE SYSCOLUM (without an 'N'!).

With that information it should be possible to generate SVG (which uses an XML format to describe its vector graphics) boxes for each table and lines between them.
How to visualize how they're related is probably the harder part.

That looks like an interesting project. I'm sure several people on this forum would be happy to have that (me included).

Another option is to generate an input file for an open source utility called GRAPHVIZ; The benefit of using that tool is that it handles the pathing issues for you. I haven't used it myself, though.


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
Expert
posted Hide Post
This is something that I wrote quite a while ago now (2+ years?) but it still functions OK and gives something close to what you want(?) by using Googles OrgChart (why reinvent the wheel?)

Anyway, for what it's worth - The table name is variablised as is the segment name. The default table is Employee but try it with WF_RETAIL.

-SET &ECHO = ON;
SET HOLDLIST = PRINTONLY

-DEFAULT &TBNAME = 'EMPLOYEE'
-DEFAULT &SEGNAME = '_FOC_NULL'

TABLE FILE SYSCOLUM
PRINT COMPUTE C_USAGE/A44 = '<span>/'||USAGE||'</span>'; NOPRINT
      COMPUTE C_NAME/A160 = IF KEYSEQ NE  0  THEN '* '|SUBSTR(255,NAME,1,50,50,'A50')||C_USAGE
	                   ELSE IF DEFINE EQ 'Y' THEN '<span style="color:rgba(255,0,0,0.5);">Define</span> '|SUBSTR(255,NAME,1,50,50,'A50')||C_USAGE
	                   ELSE IF DEFINE EQ 'F' THEN '<span style="color:rgba(255,0,0,0.5);">Filter</span> '|SUBSTR(255,NAME,1,50,50,'A50')||C_USAGE
	                   ELSE SUBSTR(255,NAME,1,50,50,'A50')||C_USAGE; NOPRINT
      COMPUTE C_SEGNAME/A60 = SUBSTR(255,SEGNAME,1,50,50,'A50')||(' ('|SEGTYPE||')'); NOPRINT
      COMPUTE COLUMS/A2042V = IF SEGNO NE LAST SEGNO THEN '<div><div class="'||SEGTYPE||'">'||C_SEGNAME||'</div><div>'||C_NAME ELSE LAST COLUMS ||'<br>'||C_NAME;
   BY SEGNO
   BY SEGNAME
   BY PARENT
   BY COLNO
WHERE TBNAME EQ '&TBNAME.EVAL'
WHERE SEGNAME EQ '&SEGNAME.EVAL'
ON TABLE HOLD AS TEMPHLD2
END
-RUN

TABLE FILE TEMPHLD2
  SUM COMPUTE COL/A2500 = LST.COLUMS||'</div></div>';
   BY SEGNO
   BY SEGNAME
   BY PARENT
ON TABLE HOLD AS TEMPHLD1
END
-RUN

TABLE FILE TEMPHLD1
PRINT COMPUTE CNTR/I3 = LAST CNTR + 1; NOPRINT
      COMPUTE COMMA/A1 = IF CNTR EQ &LINES THEN '' ELSE ','; NOPRINT
      COMPUTE HARCHY/A4096 = '[{v:'''||SEGNAME||''', f:'''||MAX.COL||'''}, '''||PARENT||''', '''']'||COMMA;
   BY SEGNO  NOPRINT
   BY PARENT NOPRINT
ON TABLE SAVE AS MYJSON
END
-RUN

-IF &LINES EQ 0 THEN GOTO :EndNow;

-HTMLFORM BEGIN
<html>
 <head>
  <script type='text/javascript' src='https://www.google.com/jsapi'></script>
  <script type='text/javascript'>
     google.load('visualization', '1', {packages:['orgchart']});
	 google.setOnLoadCallback(drawChart);
	 function drawChart() {
	      var data = new google.visualization.DataTable();
		  data.addColumn('string', 'Name');
		  data.addColumn('string', 'Manager');
		  data.addColumn('string', 'Tooltip');
		  data.addRows([
!IBI.FIL.MYJSON;
		  ]);
	      var chart = new google.visualization.OrgChart(document.getElementById('chart_div'));
	      chart.draw(data, {allowHtml:true, allowCollapse:true, size:'small'});
	 }
  </script>
  <style>
     .google-visualization-orgchart-node {vertical-align:top;}
     div {vertical-align:top;text-align:left;}
     span {color:#999;}
     .S {background-color:#faa;}
     .U {background-color:#afa;}
     .SH {background-color:#daa;}
     .KM {background-color:#fcc;}
     .KU {background-color:#ccf;}
     .KL {background-color:#aac;}
     .KLU {background-color:#99a;}
  </style>
 </head>
 <body>
   <div id='chart_div'></div>
 </body>
</html>
-HTMLFORM END

-:EndNow


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Member
posted Hide Post
Tony,
It works great, this was exactly what I was looking for! Thank you, Wep, and Hallway for all the help!
 
Posts: 10 | Registered: June 19, 2018Report This Post
Platinum Member
posted Hide Post
I put Tony's solution in my toolbox. Very nice.


WebFOCUS 8.2.03 - Production
WebFOCUS 8.2.04 - Sand Box
Windows 2012 R2 Server
HTML, PDF, Excel
In FOCUS since 1980
 
Posts: 115 | Location: Seattle, WA | Registered: April 07, 2015Report This Post
Virtuoso
posted Hide Post
Tony, I think you're missing a bit at the top to make it truly brilliant. You probably have that in your profile or something, but the code you posted doesn't display JOINs and DEFINE's.

SQL FMI SET JOINFIELDS ON
SQL FMI SET TEMPDEFINES ON


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
Master
posted Hide Post
Good One

Great share TonyA.


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Report This Post
Virtuoso
posted Hide Post
Nice! Thanks for sharing this Tony. Really slick! Appreciate it!


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report 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] Displaying a graphical representation of joins

Copyright © 1996-2020 Information Builders