![]() |
Powered by QM on a Rpi server |
|
KnowledgeBase 00042: The CUMULATIVE KeywordThis article was originally published as a Tip of the Week. It is often useful to maintain a running total for a field in a query processor report. The CUMULATIVE keyword provides an easy way to do this. CUMULATIVE is an arithmetic qualifier and can be used in the display clause just like TOTAL, AVERAGE, etc. ExampleThe following simple example is based on QM's sales processing demonstration database. list sales by cust break.on "'OL'" cust item qty price line.value cumulative line.value col.hdg "Total" SALES..... Cust Item Qty Price Line Total Total. 12001 1000 001 2 1.70 3.40 3.40 003 1 1.70 1.70 5.10 12333 013 1 0.30 0.30 5.40 032 6 1.90 11.40 16.80 055 6 2.87 17.22 34.02 041 5 0.50 2.50 36.52 12371 012 6 0.30 1.80 38.32 002 6 1.70 10.20 48.52 032 5 1.90 9.50 58.02 054 6 0.99 5.94 63.96 Related ArticlesNone. |