Focal Point
[CLOSED] i need one field what have 2 formats integer and char

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

March 22, 2013, 05:47 AM
expertomad
[CLOSED] i need one field what have 2 formats integer and char
Good morning.

I need beleive a compute this field have admit char '- -' and number , i dont know that format put example:

TABLE FILE EXPENSES
SUM
COMPUTE FIELD/D12.2 = IF FIELD EQ '' THEN '--' ELSE FIELD ;
BY NAME
END


NAME FIELD
JON 7.8
JANE 6
FRANCIS --



I dont know that format put.

Thanks for all.

Good day.

This message has been edited. Last edited by: <Kathryn Henning>,
March 22, 2013, 06:06 AM
Danny-SRL
Isma,

Your code is strange.
  
COMPUTE FIELD/D12.2 = IF FIELD EQ '' THEN '--' ELSE FIELD ;

What is the original format of FIELD? Alpha? Numeric?


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

March 22, 2013, 06:11 AM
Tony A
Try this code -
TABLE FILE EXPENSES
SUM COMPUTE FIELD/A12 = IF FIELD EQ 0 THEN '--' ELSE FPRINT(FIELD, 'D12.2', 'A12') ;
BY NAME
END


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
March 22, 2013, 06:17 AM
expertomad
quote:
COMPUTE FIELD/A12 = IF FIELD EQ 0 THEN '--' ELSE FPRINT(FIELD, 'D12.2', 'A12') ;

Hello tny you understand me , you solution have a 10 thanks for all
March 22, 2013, 06:18 AM
expertomad
Hello danny my field have tha acept 2 format .
thanks for all
March 24, 2013, 08:39 PM
Waz
Another option, if it fits in with your report is to use MISSING.

e.g.
SET NODATA = '--'
TABLE FILE EXPENSES
SUM COMPUTE FIELD/D12.2 MISSING ON = IF FIELD EQ 0 THEN MISSING ELSE FIELD) ;
BY NAME
END



Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!