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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
Next Record
 Login/Join
 
Platinum Member
posted
I run into this problem all the time and wanted to know how others solved it. Let's say I have 5 records sorted by date and I want to pick out the two records whose dates are within 30 days of each other. What I have been doing in the past is making a flag that says FLAG/A2 = IF (DATE - LAST DATE) LE 30 THEN 'A' ELSE ' '; but that only flags the second record of the two that I want. Is there a way to say "if this record is within 30 days of the previous record then flag the current record and the previous record"?

Thanks for the help!


Windows version 768
 
Posts: 215 | Registered: March 16, 2006Report This Post
Virtuoso
posted Hide Post
I think when you put the first reult in a hold file and than create the same action but now sorted descending you will get the result you want.

if you have many many records it will take some time....




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Expert
posted Hide Post
if i understand you correctly, that LAST RECORD
has 2 comparisons that make it eligible for display, is comparison to the record AFTER it, and to the record BEFORE it,
is that correct?
if so,
then Frank's suggestion is the good one.
process the file in ascending order comparing to last record, and create a flag DISPLAY/I1 = 1 OR 0 depending on your decision.
then process the resultant file in DEscending order, keeping the DISPLAY field, and calculating a new one, 1 if DISPLAY is already a 1 and then based on the regular comparison determination to its own LAST record, if the incoming DISPLAY value had been 0.
then just print out everything where this DISPLAY value is 1.
There's probably a macgyerish way to join this file to itself upside down and make the determination in 1 fell swoop... so maybe someone will come along and show us how to do that.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Platinum Member
posted Hide Post
Thanks to both of you. I have been doing it that way (sorting in descending after first hold). Thanks again!


Windows version 768
 
Posts: 215 | Registered: March 16, 2006Report This Post
Guru
posted Hide Post
If you have not too many rows, Maintain would be useful. Eg.

x = stk.focindex;
if stk(x).date - stk(x-1).date lt 30 then
begin
type on out
"<stk(x).date <stk(x-1).date";
endbegin

that will give you a row with the two dates on the text file out.

Håkan


WebFOCUS DS 8.0.06/08 DS/AS
WebFOCUS RS 8.0.08 (Linux/IBM i)
WebFOCUS Client 8.0.06 (Linux)
 
Posts: 319 | Location: Stockholm, Sweden | Registered: February 04, 2004Report This Post
Virtuoso
posted Hide Post
Mark

I was thinking on this issue again.
Why do you want to do this?
The solution technical works but what can happen if you do it this way is that you get a lot of flags and they do tell you nothing anymore.

I tried something with the following figures

date diff days
15-jan	
17-jan	2
24-jan	7
14-feb	21
18-feb	4
28-feb	10
3-mrt	3
17-mrt	14
22-mrt	5
31-mrt	9
1-apr	1
8-apr	7
25-apr	17
  

If the cluster is 2 days you would get a flag on only 31/mar and 1/apr so that looks ok, but if the difference would we 8 days you should get flags on all the lines and some dates would be part of two clusters. Than it is not working anymore.

I do not have the proper solution, but what might help is not giving all the clusters the same code but making that code the lowest or highest of the two days.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders