Focal Point
[SOLVED] @ Sign in BY TOTAL COMPUTE

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

November 05, 2019, 10:13 AM
Brandon Andrathy
[SOLVED] @ Sign in BY TOTAL COMPUTE
Hello,

I'm trying to do a simple table file and I am trying to accommodate for missing on a BY line by doing BY TOTAL COMPUTE = IF FIELD IS MISSING THEN 'N/A' ELSE FIELD. When That happens, the table runs as expected, however the field name I originally tried to define displays as @2853_FIELD.

Does anyone know why this is happening and what I can do to fix it? Code example below:

 TABLE FILE _ADM_STAR
SUM 
    PAIDAMT
BY TOTAL COMPUTE FIELD/A100V MISSING ON = IF FIELD IS MISSING THEN 'N/A' ELSE FIELD; AS 'FIELD'
ON TABLE SET ASNAMES ON
ON TABLE SET HOLDLIST PRINTONLY
END

This message has been edited. Last edited by: Brandon Andrathy,


WebFOCUS 8204
November 05, 2019, 10:43 AM
Danny-SRL
Brandon,
Can you repro using the CAR file?


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

November 05, 2019, 01:35 PM
Hallway
In looking at your compute named FIELD which is also referencing FIELD, I am assuming that you have another field named FIELD in the datasource? is that a defined field that you didn't include in the code?

 BY TOTAL COMPUTE FIELD/A100V MISSING ON = IF FIELD IS MISSING THEN 'N/A' ELSE FIELD; AS 'FIELD' 


Also, are you trying to TOTAL an alpha field? I've never seen a COMPUTE in a BY field before.

I agree with Danny-SRL that in order for us to help you, we need you to reproduce the error with a file from the ibisamp folder, like the car file, so that we can run the code on our end.


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
November 05, 2019, 01:45 PM
Brandon Andrathy
I figured it out. Instead of By total, I just did By compute and that did what I wanted it to Smiler . Closing it


WebFOCUS 8204
November 05, 2019, 01:59 PM
MartinY
quote:
Originally posted by Hallway:
Also, are you trying to TOTAL an alpha field? I've never seen a COMPUTE in a BY field before.

This is a valid action to perform BY TOTAL COMPUTE …
A "BY TOTAL TOTAL" doesn't means that is sum the value. It means such as "perform once everything else is done".
In other words : once the WHERE SUM/PRINT and basic SORT (BY) are completed, create the new field FIELD based on the sentence next the equal sign.

quote:
Originally posted by Brandon Antrathy:
BY TOTAL COMPUTE FIELD/A100V MISSING ON = IF FIELD IS MISSING THEN 'N/A' ELSE FIELD; AS 'FIELD'

Try with
BY TOTAL COMPUTE FIELD/A100V MISSING ON = IF FIELD EQ MISSING THEN 'N/A' ELSE FIELD; AS 'FIELD'



WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007