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.
Can this function be written in FOcus? ALTER FUNCTION [dbo].[GetPhoneClean] ( @strAlphaNumeric VARCHAR(256) ) RETURNS VARCHAR(256) AS BEGIN DECLARE @intAlpha INT
SET @intAlpha = Patindex('%[^0-9]%', @strAlphaNumeric)
BEGIN WHILE @intAlpha > 0 BEGIN SET @strAlphaNumeric = Stuff(@strAlphaNumeric, @intAlpha, 1, '') SET @intAlpha = Patindex('%[^0-9]%', @strAlphaNumeric) END END
RETURN SUBSTRING(Isnull(@strAlphaNumeric, 0),1,10) END
This function gets first 10 numeric charecters of from phone number filed. How can I accomplish this in webfocus.
My phone number field has some bad data and I want to show it in a standard format only 10 digit phone number and remove ext, person name etc.This message has been edited. Last edited by: Kerry,
Though a similar functionality can be implemented in WebFOCUS, it won't necessarily be "elegant".
Wouldn't it be better to just cleanse the values in your database -either permanently in a new field or exposed as a calculated value in a view- and use that in your report?
As you already have a stored function that does that in your database it should be relatively easy to reuse in a view, shouldn't it?This message has been edited. Last edited by: njsden,
There does not appear to be any way to strip undesired characters from a string, so all I could come up with is a process to verify each character in the string - keep if numeric, reject if not.
This is an example of a "DEFINE FUNCTION" - a method of creating reusable code that can be called by Dialogue Manager or reporting. It uses the SUBSTR function to isolate one character at a time and then CHKFMT to check the format of the character. If it's numeric, keep, if it's not, reject. (I use the -REPEAT Dialogue Manager command to avoid writing 20 lines of code).
First, create the function:
DEFINE FUNCTION EXTRACTNUMS(INSTRING/A20)
-REPEAT ENDREP FOR &CTR FROM 1 TO 20
S&CTR/A1 = IF CHKFMT(1, SUBSTR(20, INSTRING, &CTR, &CTR, 1, 'A1'), '9', 'I1') EQ 0 THEN SUBSTR(20, INSTRING, &CTR, &CTR, 1, 'A1') ELSE '';
-ENDREP
EXTRACTNUMS/A20 = S1||S2||S3||S4||S5||S6||S7||S8||S9||S10||S11||S12||S13||S14||S15||S16||S17||S18||S19||S20;
I can improve this slightly by making the input string variable in length, but I would have to rely on a Dialogue Manager variable. I could also change this to extract either the alpha characters or the numeric characters...
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
Francis and Njsden thank you so much for you help. It will work in my environment. I am going to test it today.
The reason I can not implement cleanup in my DB is because on the front end it is free form entry at the moment and to change the free form entry or impacting DB can create a new project for me.