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     [SOLVED] make a field into a date format

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] make a field into a date format
 Login/Join
 
Member
posted
I am new to webFOCUS, so this might be easy. I am makeing a graph with a across field. I am trying to get that field to sort as a date instead of integer. the current date format looks like this: "2008-10" My questions is how and where do i declare that its a date and not a integer?

thanks for any help
-C

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


Charles P

WebFOCUS 7.1.4
Win XP Pro 2002
service pack 3
 
Posts: 9 | Registered: October 21, 2008Report This Post
Expert
posted Hide Post
If your date field is an integer, this should work:

DEFINE FILE ...
D2/I6YYM = D1;
END

Convert the integer to an integer with Year/Month format.


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
Member
posted Hide Post
thanks.

does it matter where i put the code in?

D2 is the field i want to change right?

and it makes a variable d1 and i refrence the D1 in my across?

what does define file ...? do i replace the ... with the name of my choice?


Charles P

WebFOCUS 7.1.4
Win XP Pro 2002
service pack 3
 
Posts: 9 | Registered: October 21, 2008Report This Post
Member
posted Hide Post
quote:
DEFINE FILE ...
D2/I6YYM = D1;
END


I couldnt get it to work. This what the code for my graph looks like:

GRAPH FILE SQLOUT
SUM VISITS PROCEDURE PERCENTAGE
ACROSS E07
BY INV_PROV_NAME

i want to change E07 from int to format YYM so that it sorts correctly.

I tried to put your code at the top just below my SQL and i tried diffrent varaiations that look like this:
DEFINE FILE DATE
E07/I6YYM = D1;
END


Charles P

WebFOCUS 7.1.4
Win XP Pro 2002
service pack 3
 
Posts: 9 | Registered: October 21, 2008Report This Post
Virtuoso
posted Hide Post
It's the other way around Charles...

DEFINE FILE SQLOUT
NEWDATE/I6YYM=E07;
END
GRAPH FILE SQLOUT
SUM VISITS PROCEDURE PERCENTAGE
ACROSS NEWDATE
BY INV_PROV_NAME
.....
END


Maybe you should ask your management to let you start with some training.
The software you trying to use is very strong and not very cheap, so some extra investment in training and reading documentation is not a wast of money....




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
i have had training, but it was in report painter. which is not very versatile. i wouldn't really call this strong. I even had a tech support guy tell me that some of things that i can do cant even be done with report painter.

i've had training, i've got manuels and books, but lets face it, this technology isn't very straight forward

by the way, thanks for your help


Charles P

WebFOCUS 7.1.4
Win XP Pro 2002
service pack 3
 
Posts: 9 | Registered: October 21, 2008Report This Post
Member
posted Hide Post
i get the following error when i insert your code:

0 ERROR AT OR NEAR LINE 294 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC282) RESULT OF EXPRESSION IS NOT COMPATIBLE WITH THE FORMAT OF FIELD:
NEWDATE
0 ERROR AT OR NEAR LINE 298 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC003) THE FIELDNAME IS NOT RECOGNIZED: NEWDATE
BYPASSING TO END OF COMMAND
(FOC009) INCOMPLETE REQUEST STATEMENT


Charles P

WebFOCUS 7.1.4
Win XP Pro 2002
service pack 3
 
Posts: 9 | Registered: October 21, 2008Report This Post
Virtuoso
posted Hide Post
But also in report painter you can create defined fields (click on the calculator icon).
Also in other languages like VisualBasic you need to create your fields before you can use them.
And if you use the GUI you have the help button that might give you the needed suggestions.

C++ or other languages need more time and experience than 2 or 3 days training.
I use this for over 20 years (coding, without the GUI) and there is not much that you can not build with webfocus....




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
Virtuoso
posted Hide Post
Difficult to say what the exact reason for this error is without knowing a bit more.

You have a big FEX that creates an SQLOUT file.
I suppose your E07 fields is an A10 (could also be A8)
You need to convert that to a date field like I6YYM, but that can not be done in one command.

Try this

DEFINE FILE SQLOUT
AYEAR/A4=EDIT(E07,'9999'); 
-* this selects only the removes the '-10' from the string '2008-10'
AMONTH/A2=EDIT(E07,'$$$$$99');
-* removes '2008-'
NEWALPHADATE/A8YYMD=AYEAR||AMONTH||'01';
-* concatenate the year and month plus the first day so you get a full date in Alpha format.
-* now you can use several converting formulas to create a smartdate...  
END





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
Charles,

Are you manipulating a file prior to the graph and creating a holdfile? If yo are, open your code and put a ?FF HOLD (or whatever you called it) and get the file format.


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

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] make a field into a date format

Copyright © 1996-2020 Information Builders