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     Dynamically Changing Column Titles with Dates

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Dynamically Changing Column Titles with Dates
 Login/Join
 
Gold member
posted
I developed a report in Web Focus, but I want to change the column titles to display different dates. I used Dialogue Manager to create a variable and this uses a dateadd function. When I subtract days from a given date, it's not giving me the correct date. Instead, it looks at the date as an integer when doing the dateadd function.

Example:
-SET &DAY23= DATEADD(&YYMD,'D',-6);
-SET &DAY22= DATEADD(&YYMD,'D',-13);
-SET &DAY21 = DATEADD(&YYMD,'D',-20);
-SET &DAY20 = DATEADD(&YYMD,'D',-27);
DEFINE FILE SQLOUT
day23t/YYMD='&DAY23';
day22t/YYMD=' &DAY22';
day21t/YYMD=' &DAY21';
day20t/YYMD=' &DAY20';

END
TABLE FILE SQLOUT
PRINT
day20 AS '&DAY20'

day21 AS '&DAY21'
day22 AS '&DAY22'
day23 AS '&DAY23'
.
.
.

The output looks like this:
20080681 20080686 20080703 20080710

It should look like this:
20080619 20080626 20080703 20080710

Any suggestions?

Winnie


Winnie

Webfocus 7.7.3
 
Posts: 83 | Registered: July 16, 2008Report This Post
Expert
posted Hide Post
The DATEADD function requires an input string in Date format. You have to use the DATECVT to first convert to Date format, then use DATEADD, then use DATECVT to convert back to alphanumeric string.

-SET &CDATE2 = DATECVT((DATEADD((DATECVT(&TODAY, 'I8YYMD', 'YYMD')), D, -6)), 'YYMD', 'I8YYMD');


It's easier to use the "Legacy" Date function AYMD to add/subtract a number of days:

-SET &DT1 = AYMD(&YYMD,-6,'I8YYMD');


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
Gold member
posted Hide Post
Thanks, Francis! This answered my question. I tried using the AYMD function, but didn't have quotes in the third parameter...My next question is can we truncate the year in the column title after that...instead of showing 20080710, I'd like it to display as 0710?

Winnie


Winnie

Webfocus 7.7.3
 
Posts: 83 | Registered: July 16, 2008Report This Post
Expert
posted Hide Post
The quickest method would be to use EDIT:

-SET &DT1 = AYMD(&YYMD,-6,'I8YYMD');
-SET DT1X = EDIT(&DT1,'$$$$9999');
-TYPE &DT1 &DT1X


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
Virtuoso
posted Hide Post
Winnie...welcome to the Forum. Please go in and update your signature with which version you are running. Thanks

** 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
Gold member
posted Hide Post
Thanks! I'll try this...


Winnie

Webfocus 7.7.3
 
Posts: 83 | Registered: July 16, 2008Report This Post
Gold member
posted Hide Post
Francis, that EDIT function worked great. I didn't really have to use the TYPE function. Thanks so much for your help!


Winnie

Webfocus 7.7.3
 
Posts: 83 | Registered: July 16, 2008Report This Post
Expert
posted Hide Post
Winnie,

Please follow the instructions in Prarie's post. It is very important and helpful to those of us who try to help you.


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
Gold member
posted Hide Post
Ginny,

I followed the instructions in Prarie's post. updated my signature and clicked on the Submit button...I'm not sure what you are referring to. Thanks.

Winnie


Winnie

Webfocus 7.7.3
 
Posts: 83 | Registered: July 16, 2008Report This Post
Expert
posted Hide Post
It is there now! It wasn't in your previous posts.


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
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Dynamically Changing Column Titles with Dates

Copyright © 1996-2020 Information Builders