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     Recursive Tree Structure

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Recursive Tree Structure
 Login/Join
 
Member
posted
I'm trying to create a report using Focus that shows who is selling what. In my table there are contractors who sell things. The contractors have any number of subcontractors. The subcontractors sometimes have subcontractors themselves. The two fields in the database are PRODUCER and SUBPRODUCER. A SUBPRODUCER is referenced by PRODUCER as a foreign key so all the subcontractors are in the same table as contractors. I need a sum of all contractors and their subcontractors.
For example, Joe, Jack, and Jill are 3 contractors. Jill works for Jack and Jack works for Joe. Jill earned $1000, Jack earned $1000 and Joe earned $1000. I want to show that Jill earned us $1000, Jack actually earned us $2000 (him and Jill combined), and Joe earned us $3000 (all of them together). Is there a way to make a recursive join or tree stucture in a where statement like
TABLE FILE PRODUCERS
SUM
REVENUE
WHERE PRODUCER EQ (RECURSIVE HERE)
END

Thanks.
 
Posts: 4 | Location: West Olive, MI | Registered: August 16, 2005Report This Post
Virtuoso
posted Hide Post
Not to make this more confusing than it needs to be, but I'm assuming that a subcontractor for one job can be a contractor for another job. In your example, What happens if Jack works for Joe on one job and Joe works for Jill on another job. It creates a never-ending circle. Do you identfy whether income is earned as a contractor or subcontractor?


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Virtuoso
posted Hide Post
Sounds like a pretty straight forward FML request. Check out the examples regarding "PROPERTY=PARENT_OF, REFERENCE=fieldname" for master files regarding parent child relationships.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Virtuoso
posted Hide Post
Try this
JOIN SUBPRODUCER IN file TAG MAIN.
TO ALL PRODUCER IN file TAG SUB. AS J1
END
JOIN SUB.SUBPRODUCER IN file
TO ALL PRODUCER IN file TAG SUBSUB. AS J2
END


Should give you a recursive join to get 3 levels of contractor. Check the Describing Data Manual for full details of recursive Joins.

This message has been edited. Last edited by: Alan B,


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report 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     Recursive Tree Structure

Copyright © 1996-2020 Information Builders