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] Converting from MtrYY format

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Converting from MtrYY format
 Login/Join
 
Platinum Member
posted
I have a bar graph report that when a user clicks on one of the bars, it runs a second report to show the detail records. The "on-click" event runs a second query, passing the "by" value from the graph to the second query.

The problem I'm having is that the value being passed to the second query is in MtrYY format, and I need to translate it back to a date value so that I can use that value as the criteria range.

What is the define that would be used to convert a MtrYY back to a YYMD?

Right now, the code passes in "January, 2009" (no quotes), and I get an error message that:

(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: January
BYPASSING TO END OF COMMAND

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


Production - 7.6.4
Sandbox - 7.6.4
 
Posts: 241 | Location: Bethesda, MD | Registered: August 14, 2007Report This Post
Virtuoso
posted Hide Post
It's easier than you'd expect. The following code does it for you:
-SET &DATUM = 'January, 2009';
DEFINE FILE CAR
DATUM/MYY WITH COUNTRY = &DATUM.QUOTEDSTRING;
END

TABLE FILE CAR
PRINT DATUM BY COUNTRY
END

Hope this helps ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Virtuoso
posted Hide Post
You will need one additional DEFINE statement to convert the MYY date to YYMD. Since the input date has no day, the resulting YYMD date defaults to the first day of the month.

DEFINE FILE CAR
 DATUM/MYY WITH COUNTRY = &DATUM.QUOTEDSTRING;
 DATE_YYMD/YYMD = DATUM ;
END
-*
TABLE FILE CAR
 PRINT DATE_YYMD
 BY COUNTRY
END


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Platinum Member
posted Hide Post
Here is the final solution:

DEFINE FILE CLEARRQST
DATUM/YYM WITH CLEARANCE = &RANGE.QUOTEDSTRING;
ENDMM/YYM=DATUM+1;
STARTDT/YYMD=DATUM;
ENDDT/YYMD=ENDMM;
END

TABLE FILE CLEARRQST
PRINT
CLEARANCE

WHERE END_DATE GE STARTDT
WHERE END_DATE LT ENDDT


So the January, 2009 value gets translated to a date range of greater than or equal to 01/01/2009, and less than 02/01/2009.


Production - 7.6.4
Sandbox - 7.6.4
 
Posts: 241 | Location: Bethesda, MD | Registered: August 14, 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] Converting from MtrYY format

Copyright © 1996-2020 Information Builders