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] problem in displaying a text with % symbol in Excel

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] problem in displaying a text with % symbol in Excel
 Login/Join
 
Gold member
posted
Hi,

I had a problem while displaying the text in excel along with '%' symbol.

I want to display a text for a column as a title like 'PMU%' with out spaces between characters. Here, in the output I'm missng the '%' symbol. It is showing as 'PMU' instead of 'PMU%'

Here is the code for testing..
  
TABLE FILE CAR
PRINT CAR OVER
COMPUTE TEST/I4 = 10 * 10; AS 'PMU%'
ON TABLE PCHOLD FORMAT EXL2K
END
-EXIT


Scenario's I tested

'PMU%' --> 'PMU'
'P%' --> 'P%'
'PM%' --> 'PM'

My ultimate objective is not miss the percentage symobol

Thanks in Advance.

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


WebFOCUS 7.6.10
Windows
Output: Excel,PDF
 
Posts: 78 | Registered: January 07, 2008Report This Post
Gold member
posted Hide Post
Subbu,
From the example it seems that OVER is causing this issue.
If you use this without OVER keyword, you will get the Percent Symbol....
Is it requirement to display the column OVER other?


WebFocus7.6.2, WebFocus 7.1.1,Windows
HTML, PDF and Excel
 
Posts: 71 | Registered: June 30, 2009Report This Post
Gold member
posted Hide Post
quote:
display the column OVER other

Yes Anmol, I'm converting some colums to rows so they are becoming row titles now I have to show "%"


WebFOCUS 7.6.10
Windows
Output: Excel,PDF
 
Posts: 78 | Registered: January 07, 2008Report This Post
Master
posted Hide Post
Not sure why such behavior, this could be the reason. When you add percentage symbol to the end of the title, excel treats it as a calculation and omits the symbol. When you force it to consider as Alpha format, then it works fine.
Hope this will help.
TABLE FILE CAR
PRINT CAR AS 'CAR12345' OVER
COMPUTE TEST/I4 = 10 * 10; AS 'PMU%'
ON TABLE HOLD AS HLD_1 FORMAT HTMTABLE
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=DATA,COLUMN=N1, CLASS=TEXTASTEXT,$
ENDSTYLE
END


SET HTMLFORMTYPE=XLS
-HTMLFORM BEGIN
<html xmlns:o="urn:schemas-microsoft-com:office:office"
 xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
 <head>
 <meta http-equiv=Content-Type content="text/html;">
 <meta name=ProgId content=Excel.Sheet>
 <meta name=Generator content="Microsoft Excel 10">
<style>
TD.TEXTASTEXT
{mso-number-format:\@}
</style>
</head>
<body>
<table>
<tr>
<td class="accountnum">
!IBI.FIL.HLD_1;
</td>
</tr></table>
</body>
-HTMLFORM END
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report This Post
Expert
posted Hide Post
Here's another method that works:

TABLE FILE CAR
PRINT 
COMPUTE TCAR/A10 = 'CAR'; AS ''
CAR AS '' OVER
COMPUTE TPMU/A10 = 'PMU%'; AS ''
COMPUTE PMU/I4 = 10 * 10; AS ''
ON TABLE PCHOLD FORMAT EXL2K
END
Instead of relying on the AS column titles, create them with COMPUTEs.


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
Gold member
posted Hide Post
Thanks for the above solution Francis. It is working fine. I have one more issue which it is not working if i am using ACROSS along with OVER.

Please find the below code:

TABLE FILE CAR
SUM CAR OVER
COMPUTE VOLT/A10 = 'PMU%'; AS ''
DEALER_COST AS ''
ACROSS COUNTRY
ON TABLE PCHOLD FORMAT EXL2K
END
 


WebFOCUS 7.6.10
Windows
Output: Excel,PDF
 
Posts: 78 | Registered: January 07, 2008Report This Post
Virtuoso
posted Hide Post
Try this:

TABLE FILE CAR
 SUM COMPUTE XCAR/A3 = 'Car'; AS ''
     CAR AS ''
  OVER
     COMPUTE VOLT/A4 = 'PMU%'; AS ''
     DEALER_COST AS ''
 ACROSS COUNTRY AS ''
 ON TABLE PCHOLD FORMAT EXL2K
END

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Gold member
posted Hide Post
Thanks for the above solution.

I want the row titles 'CAR' and 'PMU %' to be displayed only once first time then for each country columns coressponding row aggregated values under each county should displayed something like below

ENGLAND INDIA
CAR BMW TYOTOA
PMU% 1000 200000

for england and india the car and PMU% is coming only one time. I want in this way. The row titles should not repeat for each country


WebFOCUS 7.6.10
Windows
Output: Excel,PDF
 
Posts: 78 | Registered: January 07, 2008Report This Post
Virtuoso
posted Hide Post
This seems to work. But I think it might be worthwhile to open a case with IBI to determine why the % sign fails to appear with format EXL2K.

TABLE FILE CAR
 SUM CAR AS 'Car'
     OVER
     DEALER_COST AS 'PMU%'
 ACROSS COUNTRY AS ''
 ON TABLE SET ASNAMES ON
 ON TABLE HOLD FORMAT HTMTABLE
END
-*
SET HTMLFORMTYPE=XLS
-RUN
-*
-HTMLFORM BEGIN
!IBI.FIL.HOLD ;
-HTMLFORM END


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Member
posted Hide Post
Thought of posting as this is a relevant thread.
In spite of trying with the .mht (Excel) format option, I am still not able to get the % symbol in the Excel output.
To isolate the issue. Please check the below example
TABLE FILE CAR
PRINT
COMPUTE TEST/A600V = 'SAMP%LE%';
CAR
ON TABLE PCHOLD FORMAT EXL2K
END
For PDF, % is being displayed on the O/P for col TEST.
For excel its simply showing as SAMPLE. However if i change the data type from A600V to A575V it is working fine. Not sure why it is getting broken after A575V. Please assist. Thanks.


WebFOCUS 7.7.05 and 8.x
Windows, All Outputs
 
Posts: 27 | Registered: December 13, 2012Report This Post
Expert
posted Hide Post
Works for me. WF 7.7.05 and Excel 2007:



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
Member
posted Hide Post
Thanks for your prompt response. I am able to get the expected output as 'SAMP%LE%' in the Command console. However when the same is getting executed in any of the Dev or Stage environemnts (FEX file) it is coming as 'SAMPLE' for the same A600V. Not sure if I need to keep some SET commands.


WebFOCUS 7.7.05 and 8.x
Windows, All Outputs
 
Posts: 27 | Registered: December 13, 2012Report 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] problem in displaying a text with % symbol in Excel

Copyright © 1996-2020 Information Builders