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] previous month in master file

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] previous month in master file
 Login/Join
 
Gold member
posted
Hi, for comparison reasons I'm trying to get an integer field containing the previous month in a master file (201208 if we're September)

Although it sounds simple enough I just can't find it!

original idea:
DEFINE PREVMON/I6=EDIT(DATECVT(DATEADD(&YYMD,'M',-1),'YYMD','YYM'))

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


Prod: WebFOCUS 8.0.06 on Win2008/Tomcat7/LDAP Mode
Test: WebFOCUS 8.0.06 on Win2008/Tomcat7/LDAP Mode
 
Posts: 59 | Registered: April 23, 2012Report This Post
Virtuoso
posted Hide Post
DEFINE FILE CAR
TODAY/YYMD = &YYMD;
PRIOR_MO/YYMD=DATEADD(TODAY,'M',-1);
PRIORM/M = PRIOR_MO;
PRIORY/MYY = PRIOR_MO
END
TABLE FILE CAR
PRINT CAR TODAY  PRIOR_MO PRIORM PRIORY
END 
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Virtuoso
posted Hide Post
To get this as an integer is not so straight forward, but in an MFD you can try:
DEFINE THISMON/YYMD='&YYMD';,ACCESS_PROPERTY=(INTERNAL),$
DEFINE LSTMON/YYM=DATEADD(THISMON,'M',-1);,ACCESS_PROPERTY=(INTERNAL),$
DEFINE INTMON/I6YYM=LSTMON;,ACCESS_PROPERTY=(INTERNAL),$
DEFINE PREVMON/I6=INTMON;,$

There may be a slightly easier approach, but can't think now.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Virtuoso
posted Hide Post
Or this....

PREV_YYM/A6YYM = DATEADD('&YYMD','M',-1);
PREV_MONTH/I6  = EDIT(PREV_YYM);


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Gold member
posted Hide Post
Thanks all for the suggestions.
Although all of the above solutions probably work in a fex, they don't seem to work in a master file...


Prod: WebFOCUS 8.0.06 on Win2008/Tomcat7/LDAP Mode
Test: WebFOCUS 8.0.06 on Win2008/Tomcat7/LDAP Mode
 
Posts: 59 | Registered: April 23, 2012Report This Post
Virtuoso
posted Hide Post
quote:
DEFINE THISMON/YYMD='&YYMD';,ACCESS_PROPERTY=(INTERNAL),$
DEFINE LSTMON/YYM=DATEADD(THISMON,'M',-1);,ACCESS_PROPERTY=(INTERNAL),$
DEFINE INTMON/I6YYM=LSTMON;,ACCESS_PROPERTY=(INTERNAL),$
DEFINE PREVMON/I6=INTMON;,$


Will work in an MFD. Have you tried it?


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Gold member
posted Hide Post
@Alan, you're absolutely right!
It did work from the start, but I got an error related to something else.

Thanks a bunch for this - it's a pity so many defines need to be created as it can't be done in a single pass.
(which was my mistake at first)


Prod: WebFOCUS 8.0.06 on Win2008/Tomcat7/LDAP Mode
Test: WebFOCUS 8.0.06 on Win2008/Tomcat7/LDAP Mode
 
Posts: 59 | Registered: April 23, 2012Report 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] previous month in master file

Copyright © 1996-2020 Information Builders