Focal Point
[CLOSED] Problem with field and missings

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

February 08, 2012, 05:27 AM
Javier Gómez
[CLOSED] Problem with field and missings
Hello All,

My WebFOCUS is version 7.7.03.
I generated a table file to a table. One of his numeric fields is format P11. The field is reported, but it contains many values ​​to zero (0). Asked to convert these values ​​to missing. so did this.

TABLE FILE XXXXX
PRINT
ORIGINAL_FIELD
COMPUTE PORIGINAL_FIELD/P11 MISSING ON=IF ORIGINAL_FIELD EQ 0 THEN MISSING ELSE ORIGINAL_FIELD;
END
-RUN

This compute, returns for missing values "-999998" for nonzero values, the correctly value.

To solve this problema, I made a compute transforming ORIGINAL_FIELD to alphanumeric number using PTOA. Was ok. But then I made a alphanumeric field to align right using RJUST did not work.

TABLE FILE XXXXX
PRINT
ORIGINAL_FIELD
COMPUTE PORIGINAL_FIELD/A18=IF ORIGINAL_FIELD EQ 0 THEN '' ELSE PTOA(ORIGINAL_FIELD,'(P11)','A18');
COMPUTE PPORIGINAL_FIELD/A18=RJUST(18,PORIGINAL_FIELD,PPORIGINAL_FIELD);
END
-RUN

In the end, what I did was create a computed field formatted I9. And run OK.

TABLE FILE XXXXX
PRINT
ORIGINAL_FIELD
COMPUTE PORIGINAL_FIELD/I9=ORIGINAL_FIELD+0;
COMPUTE PPORIGINAL_FIELD/I9 MISSING ON=IF PORIGINAL_FIELD EQ 0 THEN MISSING ELSE PORIGINAL_FIELD;
END
-RUN

This is a poltergeist!! I don´t understant that P11 field can't be put missing values and transformed in alphanumeric with PTOA can not align right with RJUST.

Regards,
Javier.

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


WF Prod: WebFOCUS & Dev.Studio 7.7.0.2
WF Test: WebFOCUS & Dev.Studio 7.7.0.3
BBDD: Oracle 9i,10g,11g SQL Server, DB2
ETL: OWB, Kettle
Other BI tools: Pentaho, MicroStrategy
February 08, 2012, 10:01 AM
Doug
Step 1: Consider checking for MISSING instead of ZERO in this line of code:
COMPUTE PORIGINAL_FIELD/P11 MISSING ON=IF ORIGINAL_FIELD EQ 0 THEN MISSING ELSE ORIGINAL_FIELD;


It's not a "poltergeist", just something to be learned, something to be understood. If you think that this is a poltergeist, then wait till you see in store ahead of you, you'll be in for the adventure of you life when you see what else is out there withjout some education on WebFOCUS...

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




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
February 08, 2012, 10:08 AM
njsden
Hi Javier,

I don't know what may be going on.

By using the CAR table, I managed to create a new "NEW_SALES" P11 field out of SALES (simulating your original P11 field) and then COMPUTE'd a new one setting NEW_SALES's value (or MISSING when NEW_SALES = 0).

DEFINE FILE CAR
NEW_SALES/P11 = SALES;
END
TABLE FILE CAR
PRINT CAR AND MODEL AND SALES AND NEW_SALES
COMPUTE FINAL_SALES/P11 MISSING ON = IF SALES EQ 0 THEN MISSING ELSE SALES;
BY COUNTRY
END


I don't seem to get that strange -999998 value you reported. In fact, I get MISSING instead of 0 as expected.

Perhaps something in your master file definition may give some clues?


On a different note, congrats on being on the 7.7.03 boat now! Would you please update your signature to reflect that + whatever database server and version you regularly use? It's all intended to tailor suggestions to something that is more relevant to your environment. Smiler



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.