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.
I'm working on pulling information about faculty from a table that is organized with an effective term. Historically we have used MATCH FILE to get the relevant effective term, then MATCH FILE *again* using that retrieved term to collect the information from the relevant records. This is really getting out of hand both in terms of resources consumed and the difficulty in maintaining and updating the reports that use this method for multiple effective-term tables.
I have begun using conditional joins to simplify many of our existing reports, but I can't figure out how to ensure that a join will pick up the correct record. Here is what I am envisioning, field and file names altered for readability:
JOIN LEFT_OUTER
FILE FACULTYASSIGNMENTS AT FACULTYASSIGNMENTS_ID TAG ASG TO ONE
FILE FACULTYDETAIL AT FACULTYDETAIL_ID TAG DET AS JFDE
WHERE ASG.FACULTYASSIGNMENTS_ID EQ DET.FACULTYDETAIL_ID;
WHERE DET.FACULTYDETAIL_EFFECTIVETERM LE &CURRENT_TERM;
WHERE DET.FACULTYDETAIL_EFFECTIVETERM {***IS THE HIGHEST OF THE AVAILABLE RECORDS***};
END
What can I do to get a join to identify the record with the highest effective term?
I have found this example SQL code that accomplishes this task, but I'm unsure of how I would implement it in a FOCUS join (different field names taken directly from example):
WHERE NOT EXISTS
(
SELECT *
FROM Vat_Rate_Details VRD2
WHERE
VRD2.rate_id = VR.rate_id AND
VRD2.effect_date < NOW() AND
VRD2.effect_date > VRD1.effect_date
)
This message has been edited. Last edited by: FP Mod Chuck,
If you already have the code in SQL, you can use "SQL pass through" : several post and doc on the subject.
Or you may have to first extract the "highest of the available records" to have them used in your JOIN as a joined file Or extract the highest date, set a variable to this value and use this new variable in your WHERE clause Or ...
Many other option may exist but difficult to tell since we don't know how your data is organized and their relationship.
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, 2013
+1 for Or extract the highest date, set a variable to this value and use this new variable in your WHERE clause
I presume you have a table you can hit where you can retrieve a single row with the value of the start of the effective term. if you need to grab the ending date at the same time, do that so they end up in one row (2 columns).
Then -READ the dates into a & variables so you can use the &STARTEFFDATE and &ENDEFFDATE in your code.
If you find that you need this date range often, I would put this in it's own focexec so you can -INCLUDE it anytime to create those two dates for you. If you use it VERY often, you might even decide to go with && global variables set from EDASPROF so that those variables are always available to all procedures.
Originally posted by MartinY: Or you may have to first extract the "highest of the available records" to have them used in your JOIN as a joined file
Okay, this gave me ideas. I can use a MATCH to look up the most recent effective term in FACULTYDETAIL for each person in my query without including any of the other information I'll be reporting on. That keeps my runtime short. I can then JOIN to the hold file I just created to use those effective terms (unique for each individual - each person gets a new effective term when the terms of their employment change) in my JOIN to FACULTYDETAIL to get the rest of the relevant information.
I would still prefer to avoid using a MATCH to do this, but I've at least significantly improved the performance of this report. This change also improves the legibility of the code.
You're right. This table is not so large that I'm saving any effort trying to query only a subset of it. I could do what you say here and produce a hold file that simply indexes the appropriate EFF_TERM for everyone. This would work on nearly every table I work with. Only 1 or 2 of our tables are so bloated that I would want to limit it to relevant people.