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.
Hi COMPUTE alphanames/A40 = SUBSTR(40, Lastname,1,1,40, 'A40'); This substr picks the first letter in the lastname field, if this is equal to letter 'A' then count all 'A's of lastnames. Like , i need to compare all alphabetic letters and gets their counts for the incoming Lastname field. the ouput is A B C D..... Z 12 4 1 19...... 4 what is the best logic for this. Thanks for the help, RamThis message has been edited. Last edited by: Kerry,
Dave, Thanks for the solution , but what i need is a logic, which gives how many(count) lastnames starts with letter A and how many with(count) lastnames starts with letter B etc...upto Z aplhabetical letters . Thanks for the help, ram
SET NODATA = 0
DEFINE FILE EMPDATA
LASTNAME_1ST_CHAR/A1 = SUBSTR(15, LASTNAME, 1, 1, 1, 'A1');
END
TABLE FILE EMPDATA
SUM
CNT.LASTNAME_1ST_CHAR AS 'EMPLOYEE,COUNT'
BY LASTNAME_1ST_CHAR
ROWS
A OVER B OVER C OVER D OVER E OVER
F OVER G OVER H OVER I OVER J OVER
K OVER L OVER M OVER N OVER O OVER
P OVER Q OVER R OVER S OVER T OVER
U OVER V OVER W OVER X OVER Y OVER Z
END
The ROWS OVER syntax is to ensure all 26 letters appear in the report, you can remove this code if all letters are not required. EMPDATA is a file in the WebFOCUS sample data folder, ibisamp.
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, Compare lastnames with all 26 aplhabets and their corresponding counts.i.e how many lastnames starts with alphabet A and their count.Like all 26 alphabets. A count(LASTNAMES) B count(lastnames) thanks, ram
Francis, The ouput is correct.Does your logic is same as this. COMPUTE alphanames/A40 = SUBSTR(40, Lastname,1,1,40, 'A40'); If alphanames eq 'A' then count(alphanames) If alphanames eq 'B' then count(alphanames); If alphanames eq 'C' then count(alphanames); If alphanames eq 'D' then count(alphanames) ; . . If alphanames eq 'Z' then count(alphanames) output is A 20-count of lastnames starts with letter A B 45--count of lastnames starts with letter B
I don't get it.. My logic does -exactly- that. I've made a sample on the CAR file.
It counts the number of cars starting with each character.
DEFINE FILE CAR
ALPHA/A1 = SUBSTR(40, CAR, 1,1,40, 'A1');
END
TABLE FILE CAR
SUM CNT.CAR AS 'NUMBER OF CARS STARTING WITH'
BY ALPHA
ON TABLE PCHOLD FORMAT HTML
END
You will not get the entire alphabet. Only the character which have data.
This fixable :
DEFINE FILE CAR
ALPHA/A1 = SUBSTR(40, CAR, 1,1,40, 'A1');
END
TABLE FILE CAR
SUM CNT.CAR AS 'NUMBER OF CARS STARTING WITH'
BY ALPHA
ROWS 'A' OVER 'B' OVER 'C' OVER 'D' OVER 'E'
OVER 'F' OVER 'G' OVER 'H' OVER 'I' OVER 'J'
OVER 'K' OVER 'L' OVER 'M' OVER 'N' OVER 'O'
OVER 'P' OVER 'Q' OVER 'R' OVER 'S' OVER 'T'
OVER 'U' OVER 'V' OVER 'W' OVER 'X' OVER 'Y'
OVER 'Z'
ON TABLE PCHOLD FORMAT HTML
END
( working & checked example )
G'luck.
_____________________ WF: 8.0.0.9 > going 8.2.0.5
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010
Take heart in that most of us knew that your response was, indeed, the solution. However, it was missing the 'A' OVER 'B' etc. has been mentioned on the Forum so many times before so, perhaps, we may have expected a quick pickup.
I guess that some of our newer members do not have the depth of knowledge (or DP background) that would give them the edge to see past the initial response(s) (is that not why they are here?). Consequently many responders may feel slighted or ignored.
Of course we could always suggest that posters remember to use the search engine (top right) but I would urge them to remember that it might need a different search to what is in their mind! This is probably one of the most common reasons for not finding what they need.
A suggestion that I would make to everyone is to signup for the digest and take the time out of their busy schedules to actually read as much as they have time for - even skim reading the content - you never know what might become useful in future. I would also suggest making a library of posted samples, giving the individual files a meaningful name. I know several "seasoned" WF Pro's that keep such a library close to hand on a memory stick.
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004