1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

how to calculate total balance per state per country using accumulate function in openedge

Discussão em 'StackOverflow' iniciado por fdantas, Março 28, 2015.

  1. fdantas

    fdantas Administrator Moderador

    I have tried the code.

    DEFINE VARIABLE totalbalance AS DECIMAL NO-UNDO.

    DEFINE FRAME f1

    WITH CENTERED THREE-D SIZE 100 BY 50.


    FOR EACH customer NO-LOCK BREAK BY country WITH FRAME f1:

    ACCUMULATE balance(TOTAL BY country).
    IF FIRST-OF(customer.country) THEN
    DISPLAY customer.country.
    DISPLAY customer.state customer.balance.
    IF LAST-OF(customer.country) THEN
    DO:
    DISPLAY SKIP FILL("-", 25) AT 50 FORMAT "x(25)".
    DISPLAY ACCUM TOTAL customer.balance AT 51.
    DISPLAY SKIP FILL("-", 25) AT 50 FORMAT "x(25)".
    END.


    END.

    It only gives total balance per country but I also want to display total balance per state.

    Continue reading...

Compartilhe esta Página