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
Grouping dates
 Login/Join
 
Member
posted
Hello, new user here.

I have a date field in my report type HYYMDS in real date format. How can I show these dates grouped by month and year instead of showing every single date entry? Thanks in advance.


-Dave
WebFOCUS 7.6.4, Windows XP, HTML output
 
Posts: 6 | Location: Walled Lake, MI | Registered: May 29, 2008Report This Post
Virtuoso
posted Hide Post
Ok...this is my last one for this week..someone else is on call after that, I'm going home.

Welcome to the Forum. Please Update your Signature with what verion your are on so we will better know how to help you.

** Update signature
1) Logon to Focal Point and go into your complete profile.
2) Scroll down the page until you see the “Signature” field.
3) Fill in the signature you want to use. Here is a sample to model:

Prod: WebFOCUS 5.2.3 on Win 2K/IIS 6/ISAPI Mode
Test: WebFOCUS 7.1 on Win 2K/IIS 6/Weblogic 8.1/Servlet Mode

4) Once all changes are made/added, scroll down to the bottom of the page and click on the Submit button.


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Expert
posted Hide Post
Dave,

A not too detailed answer would be, using date functions in the Functions manual, to extract the month and year into a define field and sort on that field instead of the detailed field.

BTW, do you work for an insurance company? I live in Ann Arbor.


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
Member
posted Hide Post
Ginny,
Thanks for the direction. I figured out how to use the MONTH function to do this but this function must be part of some package that my company did not purchase. What other function or method would you recommend?

Side note: I do not work for an insurance company.


-Dave
WebFOCUS 7.6.4, Windows XP, HTML output
 
Posts: 6 | Location: Walled Lake, MI | Registered: May 29, 2008Report This Post
Expert
posted Hide Post
Dave,

Check out the Dates chapter in the Functions manual. If you have WF, you have all of the functions documented therein. You could use HDATE, HPART, HNAME as possibilities appropriate use of EDIT and concatenation. Play around with these as see what you come up with.


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
Platinum Member
posted Hide Post
Dave, try this in a compute
[NU_DATE/YYMD = HDATE(THEHYMDSSDATE, 'YYMD');/]

This'll place your results into a 'yymd' format. You can refine this further to just contain yr/month only and then sort on that grouping. I recommend using 'SEARCH' button above and typing in HDATE Example - to get you started in the right place. Ira aix 533 wf 537(d) 533(p)

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


aix-533,websphere 5.1.1,apache-2.0,
wf 538(d), 537 (p),
==============
7.6.11 (t) aix 5312
websphere 6.1.19
apache 2.0
 
Posts: 195 | Registered: October 27, 2006Report This Post
Master
posted Hide Post
Hi Dave, welcome to WF. You didn't get a very definitive answer because this question has been asked and answered dozens of times. However, all these old-timers forget that new comers may not know how to search the forum or how to get manuals.

The good news, all of IBI's manuals can be downloaded in PDF format for free! Printed copies are available through IBI for a fee. Click the button at the top right that says "Technical Documentation Library" and download "Creating Reports with WebFocus Language.." for your version. Also, Describing Data and WebFocus Graphics. If you are an admin there are a few others you will need. Also find Alphabetical list of functions and subroutines.

You can search the forum by click the search button on the top left (looks like a magnifying glass) right next to the new button. You can also search from GOOGLE, preface your request with WebFocus and your request.
You will get more help if you first try to help yourself.

Now to be really nice, I will answer your question.
DEFINE FILE yourfile
NEW_DATE/YYMD=HDATE(OLD_DATE,'YYMD');
NEW_DATE1/A8YYMD=NEW_DATE;
NEW_DATE2/A6=EDIT(NEW_DATE1,'999999');
END
TABLE FILE yourfile
SUM X
BY NEW_DATE2
END


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Virtuoso
posted Hide Post
Hi Dave

You have got some helping tips. I will not confuse you but I would do the last one a bit different.

DEFINE FILE yourfile
NEW_DATE/YYMD=HDATE(OLD_DATE,'YYMD');
NEW_YEAR/YY=NEW_DATE;
NEW_MONTH/YYM=NEW_DATE;
END
TABLE FILE yourfile
SUM X
BY NEW_YEAR
BY NEW_MONTH
END


the difference is this:
Pat's solution convert the smartdate "NEW_DATE" to an alpha date and then removes the day part.
My solution keeps the date format internal that can help you better. You can easy calculate the difference between smartdates in months, years and days.
To learn more about the date functions you can buy a very smart book (25 U$) "almost 1001 Ways to Work with Dates in WebFOCUS"

I hope this helps...




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
Member
posted Hide Post
Thank you all for your help so far. I'm getting there...
I am not sure why or how to use the table in this last example. I get an error "(FOC003) THE FIELDNAME IS NOT RECOGNIZED: X" so X must be a variable that I'm not sure how to use.

Thanks again!


-Dave
WebFOCUS 7.6.4, Windows XP, HTML output
 
Posts: 6 | Location: Walled Lake, MI | Registered: May 29, 2008Report This Post
Expert
posted Hide Post
Dave,

The X is where you put X COLUMNS you are PRINTing or SUMming...

It is "NOT" an actual COLUMN; maybe this will explain better:

 
DEFINE FILE yourfile
NEW_DATE/YYMD=HDATE(OLD_DATE,'YYMD');
NEW_YEAR/YY=NEW_DATE;
NEW_MONTH/YYM=NEW_DATE;
END
TABLE FILE yourfile
SUM 
   COLUMN_NAME1
   COLUMN_NAME2
   ETC.....
BY NEW_YEAR
BY NEW_MONTH
END


Tom


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
Dave's not here!


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
DAve be sure to replace 'yourfile' in this example with the file you want to use...

unless "yourfile" is a real database file.

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




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
Platinum Member
posted Hide Post
Frank, wouldn't that make it "myfile" Smiler


aix-533,websphere 5.1.1,apache-2.0,
wf 538(d), 537 (p),
==============
7.6.11 (t) aix 5312
websphere 6.1.19
apache 2.0
 
Posts: 195 | Registered: October 27, 2006Report This Post
Master
posted Hide Post
No Ira, that would make it Dave's File.


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Expert
posted Hide Post
Dave's not here!


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Master
posted Hide Post
Well why did he ask the question if he wasn't going to hang around and get the answer.


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Member
posted Hide Post
Dave IS here! I've been reading all of these posts and they are all helpful. I've been using the examples in my reports as I learn. I still have a long way to go. I will be around. So fear not, PBrightwell, you are appreciated!


-Dave
WebFOCUS 7.6.4, Windows XP, HTML output
 
Posts: 6 | Location: Walled Lake, MI | Registered: May 29, 2008Report This Post
Expert
posted Hide Post
WOOHOO!!!!!

Dave is here!!!! Big Grin

Just havin' some fun, Dave...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Master
posted Hide Post
We occassionally post a tease in the Forum. Keeps us all from taking our selves too seriously. Eeker


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders