Focal Point
Convert Alpha to Number and Store in a numeric field - possible???

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

May 28, 2007, 04:18 AM
Prasanna
Convert Alpha to Number and Store in a numeric field - possible???
All,
I have a requirement where i need to validate a column such a way whenever i found zero in the column then it should say 'N/A' else it has to do the given calculation. I had used FTOA for this.here is the define condition that i used.
 COLAB/A15=IF COLA EQ 0 THEN 'N/A' ELSE FTOA((COLA / COLB), '(D12.2-%)', COLAB);
 
.
But because of this i am getting delay in report,and also for a given condition it gives some junk values.Then in total also i am not able to see the values for the given column.

Is there a way to store the 'N/A' in the numeric feild?If i store 'N/A' as number then there will be any issues in the grand total of the column?

Any sugeestion or existing discussions??

Regards


Dev:
Dev Studio 7.1.6,Report Caster 7.1.1,Servlet
Local:
Dev Studio 7.1.6,Report Caster 7.1.1,Apache 5.0.2,
Win XP


May 28, 2007, 04:37 AM
FrankDutch
Prasanna

If I understand this well the field is an alpha format?

You can say

NEWFIELD/D12.2=EDIT(ALPHAFIELD);

then if the field is real alpha you will get 0, you can now do any calculation on this numeric field

If the field is numeric it depends if it is packed or not
take a look at PTOA for this.

Use FIND in the focalpoint forum to find other questions and solutions on this issue.

have a nice day....




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

May 28, 2007, 04:52 AM
Prasanna
Frank,
I need it in other way around. If the column data has 0 then the column should display N/A, else i need to get the calculation of the define.

Regards


Dev:
Dev Studio 7.1.6,Report Caster 7.1.1,Servlet
Local:
Dev Studio 7.1.6,Report Caster 7.1.1,Apache 5.0.2,
Win XP


May 28, 2007, 05:04 AM
Alan B
Try a DEFINE:
SET NODATA='N/A'
DEFINE FILE Fn
miss_field/D12.2 MISSING ON = IF field EQ 0 THEN MISSING ELSE field;
calc_field/D12.2 MISSING ON = calculation on miss_field; 
END
TABLE FILE Fn
PRINT field miss-field calc_field
.
.
END



Alan.
WF 7.705/8.007