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     get MAX of a DATE field into the HEADER ??

Read-Only Read-Only Topic
Go
Search
Notify
Tools
get MAX of a DATE field into the HEADER ??
 Login/Join
 
Expert
posted
anybody know how to get the MAX of a DATE/yymd field into a header?
i tried  <MAX.DATE ...nada
i tried <LST.DATE ... nada
i tried <TOT.DATE ... zippo
i tried <MAX. DATE  ... nada [with that funny blank you sometimes need for stuff)

argh!!!




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
Guru
posted Hide Post
This seemed to work for me:

TABLE FILE EMPDATA
HEADING
"The last employee was hired on: <MAX.HIREDATE> </1"
SUM MAX.HIREDATE NOPRINT
PRINT HIREDATE
BY HIREDATE NOPRINT
  BY PIN
END
  


ttfn, kp


Access to most releases from R52x, on multiple platforms.
 
Posts: 346 | Location: Melbourne Australia | Registered: April 15, 2003Report This Post
Expert
posted Hide Post
Karen,

You don't say what release you used although I guess it was as per Susannah's signature. I'm not sure that it matters anyway as the code you give is what I would normally do for this anyway!

Susannah,

The important bit of code is, as Karen has, is the SUM MAX.datefield NOPRINT before your next verb object such that is obtains the max date field value at TABLE level which is what you require.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
i tried that, melbourne, didn't work.
i got nada




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
Expert
posted Hide Post
i did that.
i got nada
i'm in 764.




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
Virtuoso
posted Hide Post
Susannah

how about putting the max date in an amper




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
Hi Susannah,

This may help:

TABLE FILE WHATEVER
SUM
MAX.DATE
ON TABLE SAVE AS MAX_DATE
END
-RUN
-READ MAX_DATE &MAX_DATE.A8.

then use &MAX_DATE in the HEADING

Hope this helps...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Virtuoso
posted Hide Post
very good Tom Big Grin




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
Master
posted Hide Post
Susannah, what Piipster suggested works fine in 7.13. Could this be a bug?


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
Expert
posted Hide Post
Works in 762 as well.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Expert
posted Hide Post
quote:
TABLE FILE EMPDATA
HEADING
"The last employee was hired on: SUM MAX.HIREDATE NOPRINT
PRINT HIREDATE
BY HIREDATE NOPRINT
BY PIN
END


Actually, works fine in 7.6.4 as well...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Expert
posted Hide Post
yes melbourne's ex works fine in 764 as well. Tom, yes but im trying to avoid the double data pass.
so that confirms the prob is in my sleep-deprived brain.
merci, mes amis.




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
Expert
posted Hide Post
quote:

but im trying to avoid the double data pass.


Ahhhhhh, a little tid-bit left unmentioned!!!

Doing the -READ is really very quick, especially, if the column is indexed, as I know, that, you know....

Have a great weekend...

P.S. Stop getiing up at 3:30 in the morning!!!!


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Expert
posted Hide Post
aha.
this works
TABLE FILE EMPDATA
HEADING
"min hire date <MIN.HIREDATE  TO max <MAX.HIREDATE> </1"
SUM MAX.HIREDATE NOPRINT
SUM  
-*CNT.DST.PIN
SALARY BY DEPT
END

but this doesn't
TABLE FILE EMPDATA
HEADING
"min hire date <MIN.HIREDATE  TO max <MAX.HIREDATE> </1"
SUM MAX.HIREDATE NOPRINT
SUM   
CNT.DST.PIN  
SALARY BY DEPT
END

Its the count distinct that blows it slam out of the water. rats. its 2pass time.
you don't even need the first SUM
Is this a bug or a feature?

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




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
Guru
posted Hide Post
Yes, Tony, unless I say otherwise I use the version and OS specified in the thread.

For example for my next version of this code I used WF R714 on Windows 2003 EE.

Renaming the MAX.datefield and putting the HEADING at the bottom seems to work with one pass:

TABLE FILE EMPDATA
SUM 
MIN.HIREDATE NOPRINT
COMPUTE MIN_DATE/YMD = MIN.HIREDATE; NOPRINT
MAX.HIREDATE NOPRINT
COMPUTE MAX_DATE/YMD = MAX.HIREDATE; NOPRINT
SUM   
CNT.DST.PIN  
SALARY BY DEPT
HEADING
"Date of most recent employee hire: <MAX_DATE "
"First employee hired on: <MIN_DATE </1"
END



ttfn, kp


Access to most releases from R52x, on multiple platforms.
 
Posts: 346 | Location: Melbourne Australia | Registered: April 15, 2003Report This Post
Expert
posted Hide Post
Thank you ,Melbourne!




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
Expert
posted Hide Post
Karen,

I guessed that was the case, I was just ensuring the readers would realise that before jumping headlong in etc......

As for the sequence of code, who would have though that it would make that much difference Confused So much for coding free of sequence requirements Frowner

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Platinum Member
posted Hide Post
Hi Suusannah,

I've never seen the use of multple SUM or PRINT verbs with a single END as illustrated in this post. Isn't the first SUM a "dangling SUM" in that it has no matching END? I think of SUM-END/PRINT-END like parenthesis that must be in matched pairs and am curious about the operation of such multiple 'openings' with only one 'closing'.

Chris


WIN/2K running WF 7.6.4
Development via DevStudio 7.6.4, MRE, TextEditor.
Data is Oracle, MS-SQL.
 
Posts: 154 | Location: NY | Registered: October 27, 2005Report This Post
Expert
posted Hide Post
Chris,

This is called a 'multi-verb' request and has been around forever. The major caveat is that the BYs be nested, i.e. either the same or every increasing. The last verb can be a PRINT.

A very useful tool.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Expert
posted Hide Post
To supplement Ginny's excellent explanation, you can also have something like
TABLE FILE yourfile
SUM fieldname
PRINT fieldname
etc. ...
(e.g. without a sort phrase between) to provide a summated value at the top level.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
Chris...oh you've just stumbled upon *the* coolest thing about wf, double verbs, triple verbs..howevermayyouwant verbs..all to create aggregates at whatever level you need.
and 1 end statement.
Now that you've discovered that, you'll never get any more sleep Wink

T, i did know about the HEADING at the end bit... i learned that one SUMMIT, probably from Renee or Noreen...just a flying one-liner that stuck in my head...ah the value of SUMMIT..
its that COMPUTE to actually get past the CNT.DST aggregation that may not ever have occured to me without the POINT here. And the fact that Melbourne is up earlier than the rest of us. thanks again, downunder.




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
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     get MAX of a DATE field into the HEADER ??

Copyright © 1996-2020 Information Builders