Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Day of the Week is acting funny. Possible glitch?
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Day of the Week is acting funny. Possible glitch?
 Login/Join
 
Member
posted
I am witness to an interesting problem that I can't figure out. The boss upstairs wanted the day of the week in addition to the date. I created a define field in the master file to take the DOWK(DATE,'A3'), and I inserted the field as a "BY" in the Report Painter. When I ran the report, the correct output from November 1 - Nov 15 is displayed (Sun, Mon, Tue, etc.), but from every date from then on, the field is empty.
It makes no sense, so I was wondering if anyone had encountered this error, and more importantly, if anyone knows what the problem might be.

Thanks

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


WebFOCUS 7.7.2: Windows 7: all output (Excel, HTML, PDF)
 
Posts: 18 | Registered: June 22, 2010Reply With QuoteReport This Post
Expert
posted Hide Post
What format is the DATE field ?

DOWK requires a date in I6YMD or I8YYMD format.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6136 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
Expert
posted Hide Post
All OK in 7.7.01 using the following code. Test it on your 7.7.02 set-up and if you have any problems then I would recommend giving IB support a call.

EX -LINES 3 EDAPUT MASTER,DATERNG,CF,MEM,FILENAME=DATERNG, SUFFIX=FOC,$
SEGNAME=SEG1
FIELD=DATE_KEY, ,DMYY ,DMYY , $
-RUN
-* Now create it
CREATE FILE DATERNG
-* and add all possible dates within a month
MODIFY FILE DATERNG
FREEFORM DATE_KEY.A8.
LOG FORMAT MSG OFF
LOG TRANS MSG OFF
LOG INVALID MSG OFF
DATA
-* This repeat loop will ensure at least a whole month is input,
-* Any invalid dates will be rejected.
-DEFAULT &Year  = 2010
-SET &Year  = EDIT(&YYMD,'9999$');
-SET &Mnth = 11;
-SET &Day   = 1;
-REPEAT :Loop1 31 TIMES;
-SET &Date = IF &Day LT 10 THEN '0' || &Day ELSE &Day;
&Date&Mnth&Year
-SET &Day = &Day + 1;
-:Loop1
END
-RUN
-*
DEFINE FILE DATERNG
  KEY_YYMD/I8YYMD = DATE_KEY;
  DOW/A3          = DOWK(KEY_YYMD,'A3');
END
-*
TABLE FILE DATERNG
PRINT DOW
   BY DATE_KEY
ON TABLE SET PAGE NOLEAD
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
  GRID=OFF, SIZE=10, $
ENDSTYLE
END

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5617 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Expert
posted Hide Post
Thanks Waz and Tony for the input.

jjeanjaquet, suggestion from our technicals:

If the date field is a smart date field then you can take advantage of the date formatting of W for day of the week.
Here is an example:

DEFINE FILE EMPDATA
HIREDATEDOW/Wt=HIREDATE;
END
TABLE FILE EMPDATA
SUM CNT.PIN
BY HIREDATEDOW
END


Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
 
Posts: 1950 | Location: New York | Registered: November 16, 2004Reply With QuoteReport This Post
Member
posted Hide Post
Thanks everbody. I did what Kerry suggested and used the date format "Wt" instead of creating an expression using DOWK() and that seems to have done the trick.

Much appreciated,

Joe


WebFOCUS 7.7.2: Windows 7: all output (Excel, HTML, PDF)
 
Posts: 18 | Registered: June 22, 2010Reply With QuoteReport This Post
Expert
posted Hide Post
At least we now know it was a Smart Date field.

Many options available.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6136 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Day of the Week is acting funny. Possible glitch?

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.