robert fuschetto Posted December 12, 2022 Share Posted December 12, 2022 I was hoping it would be an option under aggregation, but it is not. Link to comment Share on other sites More sharing options...
Mat Barnard Posted December 12, 2022 Share Posted December 12, 2022 Look up the RUNNING_SUM function. Link to comment Share on other sites More sharing options...
robert fuschetto Posted December 12, 2022 Author Share Posted December 12, 2022 I am using App Studio.This seems to work for the CARS file:TABLE FILE CARSUM RCOSTCOMPUTE RUN_TOT=LAST RUN_TOT + RCOST;BY COUNTRYEND Yet this code does not work for my file. WHAT AM I MISSING HERE?TABLE FILE TBLMSTR_CHGUNITWRVUSTATSBYDAYSUM WRVUSCOMPUTE WRVUS_RT = LAST WRVUS_RT + WRVUS ;BY POST_DATEWHERE RPTBANBR EQ 30062 AND PROVIDERNAME EQ 'MARKOWITZ, MOSHE';END Link to comment Share on other sites More sharing options...
David Briars Posted December 12, 2022 Share Posted December 12, 2022 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 Link to comment Share on other sites More sharing options...
robert fuschetto Posted December 12, 2022 Author Share Posted December 12, 2022 Well, this runs fine:TABLE FILE CARSUM RCOSTCOMPUTE RUN_TOT=LAST RUN_TOT + RCOST;BY COUNTRYI see no difference in my code:TABLE FILE TBLMSTR_CHGUNITWRVUSTATSBYDAYSUM WRVUSCOMPUTE WRVUS_RT = LAST WRVUS_RT + WRVUS ;BY POST_DATEDo 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 More sharing options...
David Briars Posted December 12, 2022 Share Posted December 12, 2022 Yep, I agree it looks like your code ties back to the model code. 😎 Is there a chance there is a field called 'WRVUS_RT' in your master? If so, you would want to give your COMPUTEd field a unique name. Link to comment Share on other sites More sharing options...
robert fuschetto Posted December 12, 2022 Author Share Posted December 12, 2022 NO! However, I did change from WRVUS_RT to WRVUS_RUNTOT and now it works! Thanks for the suggestion...if I had time I'd open a case w/IBI to see what gives! Link to comment Share on other sites More sharing options...
David Beagan Posted December 12, 2022 Share Posted December 12, 2022 Looking at past function manuals, it seems that the RUNNING_SUM funtion started with the 8.2.xx release. Interestingly, the latest 9.1 functions manual still shows an example of how to do a running sum using the LAST function, as well as, an exmple with RUNNING_SUM. Link to comment Share on other sites More sharing options...
David Briars Posted December 12, 2022 Share Posted December 12, 2022 @Robert Fuschetto Glad it worked. (Maybe there is a field in the master that begins with 'WRVUS_RT'?) @David Beagan Ohhh.... 'RUNNING_SUM' is a function. I see it now in the 'Using Functions' manual; was looking in the 'Creating Reports' manual. Thank you! Link to comment Share on other sites More sharing options...
robert fuschetto Posted December 22, 2022 Author Share Posted December 22, 2022 is that in v8.207v28? Link to comment Share on other sites More sharing options...
David Beagan Posted December 22, 2022 Share Posted December 22, 2022 @Robert Fuschetto Are you asking if RUNNING_SUM is in v8.207v28 ? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now