Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Comma in Column Title when using ACROSS and COMPUTE
Go
New
Search
Notify
Tools
Reply
  
Comma in Column Title when using ACROSS and COMPUTE
 Login/Join
 
Expert
posted
Why does the comma in the column title of the compute statement not work?

TABLE FILE CAR
SUM
SALES AS ''
DCOST NOPRINT
BY COUNTRY
ACROSS SEATS AS ''
COMPUTE TOT_COST/D15 = DCOST; AS 'TOTAL,COST'
END
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteReport This Post
Virtuoso
posted Hide Post
One of my co-workers opened a case with IBI on this topic...this is the answer he got:

That is because there is a restriction that states that only ONE line
of text is supported with an ACROSS.
You would have to do someting line suppress the default title with
SUM/PRINT field AS ''(two single quotes, next to each other) and then
do a -- ON TABLE SUBHEAD, and basically create your own Heading -- but then
youwould have to make sure to align everythig in it, since you are also
styling the report.
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Reply With QuoteReport This Post
Expert
posted Hide Post
Prarie22,

Thanks for the information. Unfortunately, as you mention, creating column titles in heading or subheading lines is not a great solution, alignment is a big problem when the report can run for multiple formats.

Cheers.
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteReport This Post
Expert
posted Hide Post
"A comma within a FIELD TITLE automatically generates a carriage return. This is
standard behavior that cannot be surpressed."

Yeah right, sounds to me like a bug that was "erradicated" in 4.3.5 has crept back in again!
 
Posts: 5669 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Virtuoso
posted Hide Post
I'm going to make a LOGICAL guess as to why this behavior is true and also give you a suggestion.

Due to the fact that the VALUES of the ACROSS field are used for the TITLES, the changing of a comma to a line break is not done. This makes sense since FOCUS has no idea if the VALUEs will contain commas, how many commas there might be in the VALUEs (there is a limit of 4 commas for a TITLE) and whether or not a user would want them converted to a line break. Even though the AS phrase text appears in the TITLE for the computed field, the disabling of the comma-to-line-break conversion propagates across (no pun intended) the entire "row" of ACROSS TITLEs. Is this a bug or an unforeseen issue yet to be addressed in a patch/release? I do not know because I have not seen this before.

Now for the suggested solution. IF your intended output format is HTML then change the AS 'TOTAL,COST' text to AS 'TOTAL<br>COST'. If you did not know, <br> is the HTML tag for a line break.

I hope this helps.
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Reply With QuoteReport This Post
Expert
posted Hide Post
I second mickey's suggestion. that works!
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Reply With QuoteReport This Post
Expert
posted Hide Post
The problem is that I have the same report running with three different formats: HTML, PDF and Excel 2000.
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteReport This Post
Member
posted Hide Post
Mickey has the right idea. A COMPUTE after an ACROSS creates (internally) another value for the ACROSS field. Since a VALUE can't span multiple lines, the COMPUTEd column title can't either.
 
Posts: 25 | Location: 2 Penn Plaza 28 fl | Registered: March 27, 2003Reply With QuoteReport This Post
Expert
posted Hide Post
Or I could do it this way:

TABLE FILE CAR
SUM
COMPUTE TOT_COST/D15 = DCOST; AS 'TOTAL,COST'
BY COUNTRY
SUM
SALES AS ''
BY COUNTRY
ACROSS SEATS AS ''
ON TABLE SET STYLE *
TYPE=REPORT, COLUMN=TOT_COST, SEQUENCE=99, $
ENDSTYLE
END
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Nice job, Francis. That does the trick.

Back to your original post that started this all, I am perplexed as to why the COMPUTE in your original post gave you one column on the right instead of a column for each ACROSS value. If you move the COMPUTE statement above the BY COUNTRY phrase it then creates a TOT_COST for each SEATS value. Is this supposed to work this way? Is the COMPUTE that appears AFTER the ACROSS phrase treated like an ON TABLE action in some way, kinda like a ROW-TOTAL? Can anyone shed some light on this? Did anyone else find this strange or did I miss an enhancement to the FOCUS language somewhere along the way? Thanks!
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Reply With QuoteReport This Post
Guru
posted Hide Post
COMPUTEs after the ACROSS did get added somewhere along the way. (I'm pretty sure I couldn't do that in 4.3.6.) I don't know when it came in, but its here by 5.21. It is put on the end just like a rowtotal is.
 
Posts: 391 | Location: California | Registered: April 14, 2003Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Comma in Column Title when using ACROSS and COMPUTE

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.