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] Different Formats in 1 field??

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Different Formats in 1 field??
 Login/Join
 
Silver Member
posted
I was wondering if it's possible to display different formats in a single field for a report. I have 1 field in my data that displays all the values we may need for any measure. The format of the field is A50V, I need to display these values in this field as either percent, number or string depending on which measure the value is for. Is this possible??

Here is an example of what the data looks like
Measure Name Score
Measure 1 50
Measure 2 Very High
Measure 3 88

Then here is what I need to the report to look like
Measure Name Score
Measure 1 50 minutes
Measure 2 Very High
Measure 3 88%


Any and all advice is appreciated, thanks!!

This message has been edited. Last edited by: cldiaz,


WebFOCUS 8204
Windows, All Outputs
 
Posts: 47 | Registered: March 21, 2014Report This Post
Platinum Member
posted Hide Post
Yes It is possible, Make conditional compute(varchar) in your table file request ,

Try Something like this, or paste your sample code
  TABLE FILE CAR
SUM
COMPUTE SCORE/A28V = IF CAR EQ 'AUDI' THEN (PTOA(SEATS, '(P3)', 'A5V')|'%') ELSE IF CAR EQ 'BMW' THEN (PTOA(SEATS, '(P3)', 'A4V')|'Minutes') ELSE 'Very High'; AS 'Score' 
BY  CAR.COMP.CAR
WHERE CAR IN ('AUDI' , 'BMW' , 'ALFA ROMEO');
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END


 
---------------------
CAR        |Score 
-----------|-------
ALFA ROMEO |Very High 
AUDI       |5 % 
BMW        |29 Minutes 

This message has been edited. Last edited by: Chaudhary,


WF Production :- WF:8.0.0.4, 8.1.05 App-studio/Developer Studio(8.1.x) ,
8.2.0.1M , 8.2.0.2 (App-Studio8.2.x),
InfoAssist/+, InfoDiscovery
Output format:-AHTML, PDF, Excel, HTML
Platform:-Windows 7, 8,10
 
Posts: 186 | Location: Infobuild India | Registered: August 28, 2015Report This Post
Virtuoso
posted Hide Post
You can DEFINE a format specifier field containing the desired WF display format and use that as your measure's type.
This format field has to be absolutely positively specified as nothing else than type A8, or it won't work.

DEFINE FILE CAR
	FMT/A8 = DECODE CAR ('AUDI' 'P3%', 'BMW' 'D12.3' ELSE 'D12');
END
TABLE FILE CAR
PRINT SEATS/FMT
BY CAR
BY MODEL
END


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Virtuoso
posted Hide Post
Or you may also want to take a look at FPRINT function

DEFINE FILE CAR
DCOST /P5    = DEALER_COST;
RCOST /P6CM  = RETAIL_COST;
PCT   /P6.1% = (RETAIL_COST - DEALER_COST) / RETAIL_COST * 100;
END
TABLE FILE CAR
SUM DEALER_COST
    RETAIL_COST
    DCOST
    RCOST
    PCT
    COMPUTE MIXFIELD /A10V = IF COUNTRY EQ 'ENGLAND' THEN FPRINT(DCOST, 'P5', 'A10V') ELSE IF COUNTRY EQ 'ITALY' THEN FPRINT(RCOST, 'P6CM', 'A10V') ELSE FPRINT(PCT, 'P6.1%', 'A10V');
BY COUNTRY
BY CAR
WHERE COUNTRY EQ 'ENGLAND' OR 'ITALY' OR 'JAPAN';
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Silver Member
posted Hide Post
Thanks all, I really appreciate the responses! I ended up using Chaudharys solution and was able to get the data to display as different formats.


WebFOCUS 8204
Windows, All Outputs
 
Posts: 47 | Registered: March 21, 2014Report This Post
Expert
posted Hide Post
i use the same thing as wep5622, have used it for years. works like a charm.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Silver Member
posted Hide Post
Updating to add that I had a second report where I had to display different formats and I used wep5622's solution and it worked beautifully!!


WebFOCUS 8204
Windows, All Outputs
 
Posts: 47 | Registered: March 21, 2014Report 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] Different Formats in 1 field??

Copyright © 1996-2020 Information Builders