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 A5 field to Integer

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Converting A5 field to Integer
 Login/Join
 
Silver Member
posted
I am fairly new to WF so excuse me if I am asking a dumb question. I searched the forums and only found converting dates to integers. I have a A5 field that we use to symbolize a specific error; ie ADD. I am looking to get a count of flags for a specific group of people and then sort descending.

Here is the code I am using right now with an edit in a define:
DEFINE FILE T_DB_ERROR_CNT
Flag_num/I6C=EDIT(T_DB_ERROR_CNT.T_DB_ERROR_CNT.FLAG);
FLAG_COUNT/I5C=IF Flag_num GE 1 THEN 1 ELSE 0;
END

Can someone take a look and help me out with this?

This message has been edited. Last edited by: <Kathryn Henning>,


8.1.0.4
Windows 7
Excel, AHTML, HTML,PDF
 
Posts: 41 | Location: North Carolina | Registered: September 14, 2012Report This Post
Platinum Member
posted Hide Post
ATODBL(source_string, length, output)

The above function converts Alpha field to Numeric


WebFOCUS - ver8201
[ReportingServers: Windows 64bit;
Client: tomcat and IIS on windows 2012
AppStudio

 
Posts: 104 | Location: Indianapolis | Registered: November 08, 2007Report This Post
Virtuoso
posted Hide Post
Warren,
What does your FLAG field contain? Numbers? Alpha values? I ask because of your "i.e. ADD".


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Silver Member
posted Hide Post
The field could have numeric and alpha characters or a combination
Some choices would be:
ADD
311
Y01


8.1.0.4
Windows 7
Excel, AHTML, HTML,PDF
 
Posts: 41 | Location: North Carolina | Registered: September 14, 2012Report This Post
Virtuoso
posted Hide Post
quote:
T_DB_ERROR_CNT.T_DB_ERROR_CNT.FLAG

This field being ALPHA, the EDIT function will return 0 when the contents is not a number.
So, if you SUM your Flag_num field you will get the number of FLAGs containing numbers only.
Is that what you wanted?


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Silver Member
posted Hide Post
No i want it for all of them whether they have numbers or not. I think that is what my issue is that it is just doing the ones with numbers. Is there a way to get those that have just ALPHA in them as well?


8.1.0.4
Windows 7
Excel, AHTML, HTML,PDF
 
Posts: 41 | Location: North Carolina | Registered: September 14, 2012Report This Post
Expert
posted Hide Post
Use CHKFMT function.
In Dev Studio, click on Help, Contents, Search, type in CHKFMT, 1st listing...
hth


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Silver Member
posted Hide Post
Tom - thanks I have tried as you suggested with the code below but when i run it the report is showing 0's all the way down for each flag.

COMPUTE FLAG_COUNT/I3 = CHKFMT(3, T_DB_ERROR_CNT.T_DB_ERROR_CNT.FLAG, 'XXX',FLAG_COUNT);

I could do a IF statement for flag saying that if FLAG_COUNT EQ 0 THEN 1 ELSE 0. Would that work?

Actually tried this and it goes back to the original issue that it counts everything that has ALPHA characters as a '1' but everything with a number as '0'


8.1.0.4
Windows 7
Excel, AHTML, HTML,PDF
 
Posts: 41 | Location: North Carolina | Registered: September 14, 2012Report This Post
Silver Member
posted Hide Post
I actually have resolved this. How do I close a thread on the forum?


8.1.0.4
Windows 7
Excel, AHTML, HTML,PDF
 
Posts: 41 | Location: North Carolina | Registered: September 14, 2012Report This Post
Virtuoso
posted Hide Post
Try this

DEFINE FILE XXXX

NUM/I7=IF FLAG EQ 'ADD' THEN 1 ELSE 0;

END

TABLE FILE XXXX
SUM NUM
BY WHATEVER
END

or...

TABLE FILE XXXX
SUM CNT.FLAG
BY WHATEVER
ACROSS FLAG
END




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
<Kathryn Henning>
posted
Hi wlwright1,

To close a thread on the forum, please reference Rule and Best Practices: Tag Your Topic with Keywords.

I've taken care of this one for you. Smiler

Cheers!

Kathryn
 
Report 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 A5 field to Integer

Copyright © 1996-2020 Information Builders