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     Using a specific date for a calculation

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Using a specific date for a calculation
 Login/Join
 
Member
posted
How do I use a specific date (not contained in my synonyms) in a calculation? For example:

Here's my sample report. I want to look in the EffectiveDate column to find the nearest date to a specific date (not contained in my table) of 1/1/2013 and return the nearest UnitPrice by ProductName.

My date to compare (not in table) is: 1/1/2013

ProductName UnitPrice EffectiveDate Jan2013Price
ABC 3.75 2/1/2012 3.90
3.90 10/2/2012
4.18 1/2/2013
4.30 7/2/2013

DEF 3.91 2/1/2012 3.96
3.96 10/20/2012
4.20 1/20/2013
4.25 7/25/2013



I would like to display the nearest UnitPrice found in a new column titled Jan2013Price then grouped by product in my report:

Can this be done?


WebFOCUS 8
Windows, All Outputs
 
Posts: 6 | Registered: November 09, 2016Report This Post
Expert
posted Hide Post
Apply the DATECVT function to the constant value so that it can be used in a date comparison function.

Here's an example:

DEFINE FILE GGORDER
ORDER_DATE_YYMD/YYMD = ORDER_DATE;

DAYS_DIF/P4 = DATEDIF( DATECVT(19960115, 'I8YYMD', 'YYMD'), ORDER_DATE_YYMD, 'D' );
END

TABLE FILE GGORDER
PRINT
ORDER_DATE_YYMD
DAYS_DIF
BY PRODUCT_CODE
END

In this example, to calculate the difference in days between a constant value and a column value, I use the DATEDIF function, and I am required to use the DATECVT function to convert the constant integer value into a date value. (I convert ORDER_DATE to a date value because in table GGORDER, ORDER_DATE has a date format of MDY (no century in the year component).


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
Expert
posted Hide Post
Apparently newer versions of WF 8 have new date functions that might make them easier to work with.


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
I'm brand new to WF just installed a week ago. How do I define a file? Do I use the Procedure View to begin a define?

Also, if I have 4 different dates to use do I create one for each?


WebFOCUS 8
Windows, All Outputs
 
Posts: 6 | Registered: November 09, 2016Report This Post
Expert
posted Hide Post
Welcome to FocalPoint.

You asked a very specific question regarding date manipulation, for which I provided an example solution.

It seems you do need a bit of training before you manipulate dates. have you read any manuals yet?

If you're suing a GUI to create reports, please read the appropriate manual.

Available online: WebFOCUS 8.0.08 Technical Library


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
Expert
posted Hide Post
quote:
If you're suing a GUI to create reports

Freudian slip Francis? Wink

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
Master
posted Hide Post
quote:
Originally posted by Tony A:
quote:
If you're suing a GUI to create reports

Freudian slip Francis? Wink

T

Can we make that a class action lawsuit? Wink


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Member
posted Hide Post
Yes, I've taken my organizations introductory course without any issues. Seems that this piece wasn't covered. Thanks for your help.


WebFOCUS 8
Windows, All Outputs
 
Posts: 6 | Registered: November 09, 2016Report This Post
Member
posted Hide Post
quote:
Originally posted by Squatch:
quote:
Originally posted by Tony A:
quote:
If you're suing a GUI to create reports

Freudian slip Francis? Wink

T

Can we make that a class action lawsuit? Wink


What is the class action lawsuit for?


WebFOCUS 8
Windows, All Outputs
 
Posts: 6 | Registered: November 09, 2016Report This Post
Master
posted Hide Post
quote:
Originally posted by CB1125:
quote:
Originally posted by Squatch:
quote:
Originally posted by Tony A:
quote:
If you're suing a GUI to create reports

Freudian slip Francis? Wink

T

Can we make that a class action lawsuit? Wink


What is the class action lawsuit for?

"If you're suing a GUI to create reports..."

(It's especially funny coming from Francis.)


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Expert
posted Hide Post
Are you using a GUI tool? The Procedure Viewer allows you to set up a DEFINE. It is documented:

WebFOCUS Release 8.0 Version 08 > Developer Studio > Creating Reporting Applications With Developer Studio > Creating Temporary Fields

WebFOCUS Release 8.0 Version 08 > App Studio > WebFOCUS App Studio Reference Guide > Creating Procedures in WebFOCUS App Studio

I don't believe a programmer should need to visit YouTube for technical assistance, but someone on the FocalPoint forum recently suggested perusing the Information Builders YouTube channel. I hope one can find something useful among the marketing material.


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
Expert
posted Hide Post
In this New New World Order, I hope I don't get sued!


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
Yes, I am using the GUI. I was thinking it would be something similar to a db_lookup and hold but I must not have it written correctly as the forums formatting is a bit different than needed inside the compute box.


quote:
Originally posted by Francis Mariani:
Are you using a GUI tool? The Procedure Viewer allows you to set up a DEFINE. It is documented:

WebFOCUS Release 8.0 Version 08 > Developer Studio > Creating Reporting Applications With Developer Studio > Creating Temporary Fields

WebFOCUS Release 8.0 Version 08 > App Studio > WebFOCUS App Studio Reference Guide > Creating Procedures in WebFOCUS App Studio

I don't believe a programmer should need to visit YouTube for technical assistance, but someone on the FocalPoint forum recently suggested perusing the Information Builders YouTube channel. I hope one can find something useful among the marketing material.


WebFOCUS 8
Windows, All Outputs
 
Posts: 6 | Registered: November 09, 2016Report 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     Using a specific date for a calculation

Copyright © 1996-2020 Information Builders