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     change default value from number type to char type

Read-Only Read-Only Topic
Go
Search
Notify
Tools
change default value from number type to char type
 Login/Join
 
Member
posted
Hi,
I have a problem where i need to change the default value with condition.
Example
output Require output
0 NO
1 YES
2 2
3 3

When value = 0, I need to display to NO, and when value = 1, I need to display to Yes,
else display their actual value

I tried the compute, and it didn't work and give me error message as:
(FOC282) RESULT OF EXPRESSION IS NOT COMPATIBLE WITH THE FORMAT OF FIELD:

any quick inputs on this is highly appreciated.
 
Posts: 28 | Registered: October 26, 2006Report This Post
Virtuoso
posted Hide Post
  
R_OUT/A3=IF OUT EQ 0 THEN 'NO' ELSE
         IF OUT EQ 1 THEN 'YES' ELSE
         FTOA(OUT,'(F3)', 'A3');


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
Expert
posted Hide Post
It depends on what format the numeric input field is.

A COMPUTE like this should do the trick:
COMPUTE OUTVAL/A10 = 
IF INVAL EQ 0 THEN 'NO' ELSE
IF INVAL EQ 1 THEN 'YES' ELSE FTOA(INVAL ,'(D8)',OUTVAL);

If the input field format is Integer, then a simple EDIT will work:
EDIT(INVAL)


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
Francis,

Yes, but you might get leading zeroes.


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
Member
posted Hide Post
Hi,

Daniel's sample above does work. But my case is complex. Originally I have COL1 and COL2, I want to be able to display COL2_REFORMAT instead:
COL1 COL2 COL2_REFORMAT
row1 0 NO
row2 1 YES
row3 2.22 2
row4 3.33 3.33
row5 44.44 44.44%

I had a define filed to change the number format, like:
IVFMT/A10 = IF COL1 EQ 'row3' THEN 'D10'
ELSE IF COL1 EQ 'row4' THEN 'D10.2'
ELSE IF COL1 EQ 'row5' THEN 'D10.2%;

TABLE FILE....
PRINT COL2/IVFMT

Now, when I just use Daniel's sample, I got all number format as: F3.
Is there a way to get the exact format showing on COL2_REFORMAT?
 
Posts: 28 | Registered: October 26, 2006Report This Post
Virtuoso
posted Hide Post
It is just a bit more complex:
IVFMT/A8 = IF COL1 EQ 'row3' THEN '(D10)'
ELSE IF COL1 EQ 'row4' THEN '(D10.2)'
ELSE IF COL1 EQ 'row5' THEN '(D10.2%)' ELSE 'A15' ;
  
COL2FMT/A15=
IF COL2 EQ 0 THEN 'NO' ELSE
IF COL2 EQ 1 THEN 'YES' ELSE
   FTOA(COL2,IVFMT, 'A15');


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
Member
posted Hide Post
That's it!!
Thank Daniel for your big help! Smiler
 
Posts: 28 | Registered: October 26, 2006Report 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     change default value from number type to char type

Copyright © 1996-2020 Information Builders