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     [SOLVED] display number format
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] display number format
 Login/Join
 
Silver Member
posted
Hello All,

I am generating a sales report

For instance, if you use below code
TABLE FILE CAR
SUM
SALES
BY COUNTRY
END

the output is like this.
COUNTRY SALES
ENGLAND 12000
FRANCE 0
ITALY 30200
JAPAN 78030
W GERMANY 88190

But I want it to display like
COUNTRY SALES
ENGLAND 12K
FRANCE 0
ITALY 30K
JAPAN 78K
W GERMANY 88K
I could think of only define, dividing the number and changing it to alpha numeric.
Please let me know if anyone has a better solution.
Thanks in advance.
SG.

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


Webfocus 7.6.8
PDF,HTML & EXCEL
 
Posts: 32 | Location: memphis,tn | Registered: January 25, 2007Reply With QuoteReport This Post
Expert
posted Hide Post
Or: COMPUTE... I don't know of anything that does a "K" like you can do a "%".
 
Posts: 3004 | Location: Middle Tennessee [8204M Gen48 in Test&Prod] | Registered: February 23, 2005Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Instead of appending K to each value, your user might be satisfied if you just note "(000 omitted)" in the heading.

TABLE FILE CAR
WRITE SUM.SALES NOPRINT
AND COMPUTE Sales/D6.0=SUM.SALES/1000; AS 'Sales,(000 omitted)'
BY COUNTRY
END


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Reply With QuoteReport This Post
Expert
posted Hide Post
That's a good one Jack... Or a footnote (SUBFOOT) to that effect: NOTE: Sales shown in Thousands... I've done that one...
 
Posts: 3004 | Location: Middle Tennessee [8204M Gen48 in Test&Prod] | Registered: February 23, 2005Reply With QuoteReport This Post
Virtuoso
posted Hide Post
SG,

Define will do the trick for you only if you have a PRINT.
If you do a SUM, then you'll have to revert to doing a COMPUTE, because you want the summed amounts to display correctly.
And, doing it this way you can't do generated (sub)totals, you'll also have to compute (RECAP) those manually.
I'd go for the Doug's suggestion. Much easier and pretty much accepted as a standard way of presenting high numbers.


GamP

- Using AS 8.2.01 on Windows 7 - IE11.
in Focus since 1988
 
Posts: 1960 | Location: Netherlands | Registered: September 25, 2007Reply With QuoteReport This Post
Expert
posted Hide Post
  
DEFINE FILE CAR
  DUMMY/A1 = ' ';
END
TABLE FILE CAR
SUM 
   SALES NOPRINT
    COMPUTE P_SALES/P6  = SALES/1000; NOPRINT
    COMPUTE A_SALES/A10 = PTOA(P_SALES, '(P6)', A_SALES); NOPRINT
    COMPUTE K_SALES/A11 = A_SALES || 'K'; AS 'Sales'
BY DUMMY NOPRINT
BY COUNTRY
ON DUMMY RECAP
    X_SALES/P6  = P_SALES;
    Y_SALES/A10 = PTOA(X_SALES, '(P6)', Y_SALES); 
    Z_SALES/A11 = Y_SALES || 'K';
ON DUMMY SUBFOOT
"Total<Z_SALES"
ON TABLE SET STYLE *
TYPE=DATA, COLUMN=N6, JUSTIFY=RIGHT,$
TYPE=SUBFOOT, HEADALIGN=BODY, STYLE=BOLD, $
TYPE=SUBFOOT, ITEM=2, JUSTIFY=RIGHT,$
END
-EXIT


Tom Flynn
WebFOCUS 7.7.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1946 | Location: Parker, CO | Registered: January 31, 2006Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Thanks Tom for jumping in, I really didn't have the time to code it ... Cool


GamP

- Using AS 8.2.01 on Windows 7 - IE11.
in Focus since 1988
 
Posts: 1960 | Location: Netherlands | Registered: September 25, 2007Reply With QuoteReport This Post
Silver Member
posted Hide Post
Thanks everyone for the input.
I will put a note in the header/footer that the data shown is in thousands.

Thanks again,
SG.


Webfocus 7.6.8
PDF,HTML & EXCEL
 
Posts: 32 | Location: memphis,tn | Registered: January 25, 2007Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] display number format

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