Focal Point
[SOLVED] display number format

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/539103022

August 25, 2009, 05:02 PM
SG
[SOLVED] display number format
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
August 25, 2009, 05:19 PM
Doug
Or: COMPUTE... I don't know of anything that does a "K" like you can do a "%".
August 25, 2009, 05:24 PM
j.gross
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
August 25, 2009, 05:40 PM
Doug
That's a good one Jack... Or a footnote (SUBFOOT) to that effect: NOTE: Sales shown in Thousands... I've done that one...
August 26, 2009, 02:48 AM
GamP
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 10 - IE11.
in Focus since 1988
August 26, 2009, 07:36 AM
Tom Flynn
  
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 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
August 26, 2009, 07:40 AM
GamP
Thanks Tom for jumping in, I really didn't have the time to code it ... Cool


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
August 26, 2009, 10:19 AM
SG
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