Come: |
Lingue disponibili: reporting
La funzione LAST richiama il valore precedente per un campo.
L'effetto di LAST dipende se appare in un comando DEFINE o COMPUTE:
Non usare LAST con il comando -SET in Dialogue Manager.
LAST fieldname
dove:
Alfanumerico o Numerico
Nome del campo.
Nota: LAST non usa un argomento di emissione.
LAST richiama il valore precedente del campo DEPARTMENT, per determinare se riavviare il totale progressivo degli stipendi per dipartimento. Se il valore precedente è uguale al valore corrente, CURR_SAL si aggiunge a RUN_TOT per generare un totale progressivo degli stipendi all'interno di ciascun dipartimento.
TABLE FILE EMPLOYEE
PRINT LAST_NAME CURR_SAL AND COMPUTE
RUN_TOT/D12.2M = IF DEPARTMENT EQ LAST DEPARTMENT THEN
(RUN_TOT + CURR_SAL) ELSE CURR_SAL ;
AS 'RUNNING,TOTAL,SALARY'
BY DEPARTMENT SKIP-LINE
END
L'emissione è:
RUNNING TOTAL DEPARTMENT LAST_NAME CURR_SAL SALARY ---------- --------- -------- ------- MIS SMITH $13,200.00 $13,200.00 JONES $18,480.00 $31,680.00 MCCOY $18,480.00 $50,160.00 BLACKWOOD $21,780.00 $71,940.00 GREENSPAN $9,000.00 $80,940.00 CROSS $27,062.00 $108,002.00 PRODUCTION STEVENS $11,000.00 $11,000.00 SMITH $9,500.00 $20,500.00 BANNING $29,700.00 $50,200.00 IRVING $26,862.00 $77,062.00 ROMANS $21,120.00 $98,182.00 MCKNIGHT $16,100.00 $114,282.00
WebFOCUS |