I need to show a percentage IF the county is greater then zero. I tried this code but it comes back "RESULT OF EXPRESSION IS NOT COMPATIBLE WITH THE FORMAT OF FIELD".
code
PCT_HO_POL/D3%=HO_REMN_POL_LMT / HO_POL_LMT;
PCT_HO_POL1/A6V=IF AGT_CTY_CD GT '0' AND HO_POL_LMT1 EQ '000000' AND HO_REMN_POL_LMT1 EQ '000000' THEN ' ' ELSE PCT_HO_POL ;
All help is greatly appriciated!!! Thank you in advance.This message has been edited. Last edited by: Kerry,
WEBFOCUS 7.6.4 Server: WINXP
April 09, 2010, 10:46 AM
njsden
You cannot assign a numeric field to an alpha field that way.
Do a search on PTOA and/or FTOA function which allows you to convert numbers to alphanumeric values.
PCT_HO_POL1/A6V=IF AGT_CTY_CD GT '0' AND HO_POL_LMT1 EQ '000000' AND HO_REMN_POL_LMT1 EQ '000000' THEN ' ' ELSE PCT_HO_POL ;
what about PCT_HO_POL1/D3% MISSING ON =IF AGT_CTY_CD GT '0' AND HO_POL_LMT1 EQ '000000' AND HO_REMN_POL_LMT1 EQ '000000' THEN MISSING ELSE PCT_HO_POL ;
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
April 09, 2010, 10:59 AM
njsden
You can also try this approach:
DEFINE FILE CAR
PCT_HO_POL/D5% = IF COUNTRY EQ 'JAPAN' THEN 0 ELSE (SALES / SALES * SEATS);
PCT_FMT/A8 = IF COUNTRY EQ 'JAPAN' THEN 'I6L' ELSE 'D5%';
END
TABLE FILE CAR
PRINT COUNTRY
PCT_HO_POL/PCT_FMT
END
The advantage of this one over the use of FTOA is that you'll be still dealing with actual numbers so they can be used in SUBTOTALs a/o TOTALs in the report.
PCT_HO_POL1/A6V=IF AGT_CTY_CD GT '0' AND HO_POL_LMT1 EQ '000000' AND HO_REMN_POL_LMT1 EQ '000000' THEN ' ' ELSE PCT_HO_POL ;
what about PCT_HO_POL1/D3% MISSING ON =IF AGT_CTY_CD GT '0' AND HO_POL_LMT1 EQ '000000' AND HO_REMN_POL_LMT1 EQ '000000' THEN MISSING ELSE PCT_HO_POL ;
This got me very close to what they are requesting. It places a period (.) in the field. :-)
Thanks for all the quick responses. I will try some of the otheres as well.
Again Thank you! I'm so close now.
WEBFOCUS 7.6.4 Server: WINXP
April 09, 2010, 11:17 AM
Latigresa
WOOHOO!! Did a SET NODATA =' ' and that completed my task!!!