Focal Point
Retrieve data in the middle???

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8521091381

August 30, 2006, 02:39 PM
Martha
Retrieve data in the middle???
I need to retieve data that is not the beginning or the last but its kinda in the middle. The request was to retrieve cases with data in between a data range. (08-01-2005 to 08-01-2006) Then I need to report the docket date of the entry that appears AFTER docket code "WXY58Z" for each case. That docket code can be anywhere within the data range and I have no idea how to do it.

DATA:
CASE# DATE DOCKET
29264 11/30/2005 SCC
29264 12/01/2005 RCPT
29264 12/01/2005 S234
29264 12/05/2005 S90
29264 01/05/2006 S136
29264 03/05/2006 S36

29265 09/30/2005 SCC
29265 12/11/2005 S11
29265 01/05/2006 S136
29265 01/01/2006 S234
29265 02/05/2006 S575

29266 10/30/2005 SCC
29266 12/01/2005 VOID
29266 12/05/2005 RCPT
29266 12/01/2005 S234
29266 12/15/2005 RCPT
29266 12/05/2005 S90
29266 01/05/2006 S13

29267 10/30/2005 S234
29267 12/01/2005 SCC
29267 12/05/2005 RCPT
29267 12/15/2005 RCPT
29267 12/05/2005 S90
29267 01/05/2006 S78

I need to report the date of docket that falls after S234.

Thank you in advance for all help provided!!

webfocus rel# is 5.2

This message has been edited. Last edited by: Martha,
August 30, 2006, 03:33 PM
.eric
You can write some sort of define that will put a 0 to a virtual field if your docket criteria has not been met, if that docket has been met assisn a 1 to that field. Also as part of that same define have it check that last value of your virtual field. So it would look something like:

DEFINE FILE ...
KEY/I1 = IF DOCKET EQ 'WXY58Z' AND LAST KEY EQ 0 THEN 1 ELSE IF LAST KEY EQ 1 THEN 1 ELSE 0;
END

then create a new hold file with that same data with WHERE KEY EQ '1'.


dev: WF 7.6.5 w/IIS + Tomcat

prod: WF 7.6.5 w/IIS + Tomcat
August 30, 2006, 04:38 PM
Glenda
Try this.

DEFINE FILE DOCKET
PULL/A1 = IF LAST DOCNO EQ 'S234' THEN 'Y' ELSE 'N';
END

TABLE FILE DOCKET
PRINT
*
WHERE DATE GE '20050801'
WHERE DATE LE '20060801'
WHERE PULL EQ 'Y'
ON TABLE PCHOLD FORMAT EXL2K
END
-EXIT


Glenda

In FOCUS Since 1990
Production 8.2 Windows
August 31, 2006, 09:16 AM
Martha
quote:
S234.

Eric & Glenda

THANK YOU!!!! Your are thee best!!

it worked!!
August 31, 2006, 12:25 PM
Martha
quote:
Originally posted by Glenda:
Try this.

DEFINE FILE DOCKET
PULL/A1 = IF LAST DOCNO EQ 'S234' THEN 'Y' ELSE 'N';
END

TABLE FILE DOCKET
PRINT
*
WHERE DATE GE '20050801'
WHERE DATE LE '20060801'
WHERE PULL EQ 'Y'
ON TABLE PCHOLD FORMAT EXL2K
END
-EXIT


Yes this worked ... but NOW they want ALL the data that follows that code for the case. I tried to set the flag to be "y" until the case number changed but its not working ..

Please help! I'm still new at this and appreciate all suggestions.

THANK YOU
August 31, 2006, 02:18 PM
Leah
quote:
DEFINE FILE DOCKET
PULL/A1 = IF LAST DOCNO EQ 'S234' THEN 'Y' ELSE 'N';
END

Try changing your define so that you check if it is a 'Y' leave it a 'Y'.

IF last PULL EQ 'Y' THEN PULL ELSE .... where your code for the define follows. I put last in lowercase as I'm not sure off head top if it works or if only in computes. If so, then you could compute PULL and do a
WHERE TOTAL PULL EQ 'Y'


Leah
September 01, 2006, 08:25 AM
Martha
this is what I did and it worked!! But would not have figured it out without eveyones suggestions!!

code
DEFINE FILE AA174401
PULL/A1 = IF LAST DOCKCD EQ '&DOCKEX'
THEN 'Y'
ELSE 'N';
PULL2/A1 = IF PULL EQ 'Y' THEN 'Y'
ELSE (IF CASE NE LAST CASE THEN ' ');
END
-*
TABLE FILE AA174401
PRINT
DDATE CTYP DESC DOCKCD CSTAND FILEDT
BY CASE
WHERE PULL2 EQ 'Y'
ON TABLE HOLD ...
/code

Thank you to all!!
Martha