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     [CLOSED] Retrieving Last Time Value When Missing

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Retrieving Last Time Value When Missing
 Login/Join
 
Member
posted
I'm using the LST function to try to retrieve the last time a document was received, not received, etc. The rec'd time field is in HYYMDS format. Everything is sorted so that I can get the last time. However, in some cases, the last rec'd time is blank so it gives me the previous time (that is actually not missing). I understand that, but still want to show the last entry, even if missing because that indicates the document was not received. I've tried using SET NODATA=* hoping this would give me the last record, but it doesn't work. I've also tried a define to place a 0 format time if the time is missing, but I receive an invalid format specification error. How can I retrieve the last entry for a HYYMDS field if there is no actual time indicated?

DOC_RECV_TIME_NEW/HYYMDS MISSING ON=IF DOC_RECV_TIME EQ MISSING THEN ?? ELSE DOC_RECV_TIME;

?? - I'm not sure how to specifiy the time format so that it would appear as 0's.

This message has been edited. Last edited by: Kerry,


WF 8009
Windows 7 Enterprise
IE 9.0
Output: All
 
Posts: 20 | Registered: May 21, 2008Report This Post
Expert
posted Hide Post
I am not able to test this, but I think if you simply define a field with missing off, the missing dates will be blank and you should then get the last value, whether it's blank or not.

DOC_RECV_TIME_NEW/HYYMDS MISSING OFF = DOC_RECV_TIME;


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
If you are dealing with a relational database, the LST prefix gets translated to MAX in SQL. You may need to HOLD the data before applying the LST prefix.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Expert
posted Hide Post
Just use DT

DEFINE FILE CAR
DATETIME/HYYMDs = DT(0000/00/00 00:00:00.000) ;
END
TABLE FILE CAR
 PRINT DATETIME
BY COUNTRY
END


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Master
posted Hide Post
.LST with Oracle (at least in 7.1.3) turns off optimization, which in effect turns a relational source into a hold file, then the .LST operation is done on the hold file. So, if there are 2 or more records that satisfy WHERE/IF statements, .LST will return the last not missing/null value. The only way I have found to reliably and efficiently get around this is to PRINT the data without and save in a hold file, using a COMPUTE to change the field(s) to not null fields, the use TABLEF with SUM and the .LST function. For example for find the last foster care placement for child 123456:
TABLEF FILE KDSPLCMT
 PRINT PL_NDATE PL_XDATE NOPRINT
       COMPUTE WK_XDATE/YYMD=PL_XDATE;
    BY PL_CLID
    BY PL_NDTTM
 WHERE PL_CLID EQ 123456
    ON TABLE HOLD
END
-*
TABLEF FILE HOLD
   SUM LST.PL_NDATE LST.WK_XDATE
    BY PL_CLID
    ON TABLE PCHOLD FORMAT WP
END

PL_XDATE is MISSING/NULL if the placement is still open. If I don't do it this way and the child has had multiple placements in foster care, LST.PL_XDATE will have the exit date of the prior placement not the last placement.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report 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     [CLOSED] Retrieving Last Time Value When Missing

Copyright © 1996-2020 Information Builders