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.
I'm trying to build a quick and simple function that takes a "session code" which is a semester in a year and convert it into a fiscal year value:
IF( SUBSTR(6, SSR_SES_CODE,5, 6, 2,'I2') in (04,05,08,09) )
THEN SUBSTR(6, SSR_SES_CODE,1, 4, 4,'I4')
ELSE SUBSTR(6, SSR_SES_CODE,1,4, 4,'I4') -1
gives me the error:
(FOC36355) INVALID TYPE OF ARGUMENT #6 FOR USER FUNCTION SUBSTR IF( SUBSTR(6, SSR_SES_CODE,5, 6, 2,'I2') in (04,05,08,09) )
Any help would be great, my SQL is lousy and quite rusty.
Edited to add:
So I got the bright idea to check the data type of my SSR_SES_CODE. It's stored as A6V, which causes one problem. The other problem is that the function SUBSTR only wants to output Alphanumeric values, not integers. Any suggestions would be great!This message has been edited. Last edited by: Max Nevill,
WebFocus 8.104 Windows 7 Entreprise, SP1
Posts: 82 | Location: Abbotsford BC | Registered: March 15, 2010
I've tried that before and it won't let me do a subtraction on an alpha numeric...
So how do I do the -1 at the end? The problem is that I'm working with university data, and the "spring" semester is technically part of the last year.
WebFocus 8.104 Windows 7 Entreprise, SP1
Posts: 82 | Location: Abbotsford BC | Registered: March 15, 2010
You could use the EDIT function instead of SUBSTR. EDIT can be used to extract portions of a string, or to convert alpha-numeric strings to integer and vice-versa.
SES_YEAR/A4 = EDIT(SSR_SES_CODE,'9999$$');
YEAR_ADJUST/I1 = IF EDIT(SSR_SES_CODE,'$$$$99') IN (04,05,08,09) THEN 0 ELSE (-1);
FISCAL_YEAR/I4 = EDIT(SES_YEAR) - YEAR_ADJUST ;
EDIT: Obviously made an error in YEAR_ADJUST calculation ... should be:
YEAR_ADJUST/I1 = IF EDIT(SSR_SES_CODE,'$$$$99') IN (04,05,08,09) THEN 0 ELSE 1 ;
This message has been edited. Last edited by: Dan Satchell,
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007