Focal Point
WHERE DID MY CODE GO?

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

August 27, 2013, 10:33 AM
RobertF
WHERE DID MY CODE GO?
I finally got some code running to report a dept by day and a running total of: 'units' which would reset itself when the dept changes. To be honest i am not even sure why the code works...but thats a minor issue at this point.

I was working in Source/text view in Webfocus 7703. I start a new procedure, go right to text mode, paste in the code below, run it..looks great btw, then save and go to physical view and Poof! the compute for the running total is gone..Kaput...no where to be found.

I had a coworker try it...same thing...what the heck is going on!

TABLE FILE ANALYZER_INVOICE_VW
BY LOWEST ANALYZER_INVOICE_VW.INVOICE.Billing_Area_ReportingNum AS 'BaNbr'
BY LOWEST ANALYZER_INVOICE_VW.TRANSACTION.TRX_PostingDt
BY LOWEST COMPUTE RUNNING_TOTAL_UNITS_ACT/D12.2 = IF ANALYZER_INVOICE_VW.INVOICE.Billing_Area_ReportingNum EQ LAST ANALYZER_INVOICE_VW.INVOICE.Billing_Area_ReportingNum THEN ( LAST RUNNING_TOTAL_UNITS_ACT + ANALYZER_INVOICE_VW.CPTCODES.Units )ELSE ANALYZER_INVOICE_VW.CPTCODES.Units; AS 'UnitsRnng'
WHERE ANALYZER_INVOICE_VW.TRANSACTION.TRX_PostingDt_Period EQ 201307;
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET BYDISPLAY ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
ENDSTYLE
END


WebFOCUS 8206.08
Windows, All Outputs
August 27, 2013, 11:39 AM
Francis Mariani
The BY LOWEST COMPUTE is not recognized by the GUI.

Something as simple as this works as code:

TABLE FILE CAR
SUM
SALES
BY LOWEST COUNTRY
BY LOWEST COMPUTE SEATSN/I5 = SEATS + 1; AS SEATS
END


and gets converted to this in the GUI:

TABLE FILE CAR
SUM 
     CAR.BODY.SALES
BY  LOWEST CAR.ORIGIN.COUNTRY
ON TABLE NOTOTAL
END

and I've never used COMPUTE in a BY statement, and I've been at it a long time...


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
August 27, 2013, 12:28 PM
j.gross
I've found the GUI also blithely converts WRITE (which remains a valid synonym for SUM*) to PRINT (which is a horse of a rather different color).

-jg


August 27, 2013, 12:34 PM
j.gross
Notes:

I was aware that "AND" is accepted as a noise word (I kinda like the sound of "AND COMPUTE ..."); but "THE" was news to me.

A simple means to indent a portion of a post is to place it within an empty list ([ LIST ] ... [ /LIST ] with no [ * ] list-item codes)
August 27, 2013, 01:38 PM
Francis Mariani
Hmmm...

DEFINE FILE CAR
THEODORE/A10 = 'HELLO';
ANDREW/A10 = 'GOODBYE';
END

TABLE FILE CAR
PRINT
THE SEATS
AND
THE MODEL
BY COUNTRY
END



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
August 27, 2013, 04:28 PM
RobertF
Francic,
thanks! I am new at all this. I think I lack of understanding as to when to use the SUM/PRINT/BY.

The code above (BY COMPUTE) yeilds a running total...I could not get it to work any other way. Open to advise!

I started over and created the same compute within the GUI and now it all works....when I toggle between text and gui and no longer disappears...the GUI altered the code a bit from what I originally had...looks like a 'TOTAL' is now in there...

TABLE FILE ANALYZER_INVOICE_VW
BY LOWEST ANALYZER_INVOICE_VW.INVOICE.Billing_Area_ReportingNum AS 'BaNbr'
BY LOWEST ANALYZER_INVOICE_VW.INVOICE.Billing_Area_ReportingName AS 'BaName'
BY LOWEST ANALYZER_INVOICE_VW.TRANSACTION.TRX_PostingDt_Period AS 'PD'
BY LOWEST ANALYZER_INVOICE_VW.TRANSACTION.TRX_PostingDt

BY TOTAL LOWEST COMPUTE RUNNING_TOTAL_UNITS_ACT/D12.2 = IF ANALYZER_INVOICE_VW.INVOICE.Billing_Area_ReportingNum EQ LAST ANALYZER_INVOICE_VW.INVOICE.Billing_Area_ReportingNum THEN ANALYZER_INVOICE_VW.CPTCODES.UNITS + LAST RUNNING_TOTAL_UNITS_ACT ELSE ANALYZER_INVOICE_VW.CPTCODES.UNITS;

WHERE ANALYZER_INVOICE_VW.TRANSACTION.TRX_PostingDt_Period EQ '201307';

ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET BYDISPLAY ON
ON TABLE NOTOTAL
ON TABLE HOLD AS RNNGTOTALSACT FORMAT ALPHA
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
ENDSTYLE
END


WebFOCUS 8206.08
Windows, All Outputs