Jump to content
The ibi Community has moved to a new platform: Please Sign In and choose Forgot Password to continue

How does one perform a running total in Web Focus


robert fuschetto

Recommended Posts

I am using App Studio.

This seems to work for the CARS file:

TABLE FILE CAR

SUM RCOST

COMPUTE RUN_TOT=LAST RUN_TOT + RCOST;

BY COUNTRY

END

image.png.feb9dd612f49fe79d445e7aacf6dae1d.png 

Yet this code does not work for my file.

WHAT AM I MISSING HERE?

TABLE FILE TBLMSTR_CHGUNITWRVUSTATSBYDAY

SUM WRVUS

COMPUTE WRVUS_RT = LAST WRVUS_RT + WRVUS ;

BY  POST_DATE

WHERE RPTBANBR EQ 30062 AND PROVIDERNAME EQ 'MARKOWITZ, MOSHE';

END

image.png.52505a53645fd5013599e80435a4f611.png 

Link to comment
Share on other sites

Not sure if RUNNING_SUM is in my release 8207.28, so I might look at using the LAST function to accumulate:

TABLE FILE CARSUM SALES/D6COMPUTE SALES_RT/D6 = IF COUNTRY EQ LAST COUNTRY THEN SALES_RT + SALES ELSE SALES; AS 'SALES, RUNNING_TOTAL' RETAIL_COSTCOMPUTE RETAIL_COST_RT/D6 = IF COUNTRY EQ LAST COUNTRY THEN RETAIL_COST_RT + RETAIL_COST ELSE RETAIL_COST; AS 'RETAIL COST, RUNNING_TOTAL'BY COUNTRYBY CARON GRAPH SET STYLE * INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/combine_templates/ENWarm.sty,$ENDSTYLEEND

image.png.2ca2811481fa7ccedf8cf45b37e93016.png

Link to comment
Share on other sites

Well, this runs fine:

TABLE FILE CAR

SUM RCOST

COMPUTE RUN_TOT=LAST RUN_TOT + RCOST;

BY COUNTRY

I see no difference in my code:

TABLE FILE TBLMSTR_CHGUNITWRVUSTATSBYDAY

SUM WRVUS

COMPUTE WRVUS_RT = LAST WRVUS_RT + WRVUS ;

BY  POST_DATE

Do you see a change I'd need t make?

WHERE RPTBANBR EQ 30062 AND PROVIDERNAME EQ 'MARKOWITZ, MOSHE';

END

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...