|
Go
![]() |
New
![]() |
Search
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Member |
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 |
||
|
|
Virtuoso |
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.
|
|||||
|
|
Virtuoso |
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.6.5 with 7.6.6 WFRS; AIX 5.2; WebSphere 6.1.0.15 Dev: WF 7.6.5 with 7.6.6 WFRS; AIX 5.3; WebSphere 6.1.0.15 Primarily self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable |
|||
|
|
Member |
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 |
|||
|
|
Virtuoso |
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.6.5 with 7.6.6 WFRS; AIX 5.2; WebSphere 6.1.0.15 Dev: WF 7.6.5 with 7.6.6 WFRS; AIX 5.3; WebSphere 6.1.0.15 Primarily self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable |
|||
|
|
Platinum Member |
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 wf 538(d), 537 (p), 7.6.1 (t) websphere 5.1.1 apache 2.0 |
|||
|
|
Master |
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 5.3.2 AIX, NT, AS/400, Focus AS/400, AIX, Oracle, JDE, DB2, Lotus Notes |
|||
|
|
Virtuoso |
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...
|
|||||||
|
|
Member |
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 |
|||
|
|
Master |
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 5.2.2 thru 7.6.x Windows, Unix, MVS |
|||
|
|
Master |
Dave's not here!
Tom Flynn WebFOCUS 5.2.2 thru 7.6.x Windows, Unix, MVS |
|||
|
|
Virtuoso |
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,
|
|||||||
|
|
Platinum Member |
Frank, wouldn't that make it "myfile"
aix 533 wf 538(d), 537 (p), 7.6.1 (t) websphere 5.1.1 apache 2.0 |
|||
|
|
Master |
No Ira, that would make it Dave's File.
Pat WF 5.3.2 AIX, NT, AS/400, Focus AS/400, AIX, Oracle, JDE, DB2, Lotus Notes |
|||
|
|
Master |
Dave's not here!
Tom Flynn WebFOCUS 5.2.2 thru 7.6.x Windows, Unix, MVS |
|||
|
|
Master |
Well why did he ask the question if he wasn't going to hang around and get the answer.
Pat WF 5.3.2 AIX, NT, AS/400, Focus AS/400, AIX, Oracle, JDE, DB2, Lotus Notes |
|||
|
|
Member |
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 |
|||
|
|
Master |
WOOHOO!!!!!
Dave is here!!!! Just havin' some fun, Dave... Tom Flynn WebFOCUS 5.2.2 thru 7.6.x Windows, Unix, MVS |
|||
|
|
Master |
We occassionally post a tease in the Forum. Keeps us all from taking our selves too seriously.
Pat WF 5.3.2 AIX, NT, AS/400, Focus AS/400, AIX, Oracle, JDE, DB2, Lotus Notes |
|||
|
| Previous Topic | Next Topic | powered by eve community |
| Please Wait. Your request is being processed... |
|

