IBI WebFOCUS - SUB-TOTAL vs SUBTOTAL & SUMMARIZE vs RECOMPUTE

We do create lot many report and many of them do have Subtotals and Grand total. Subtotals are mainly required in Sales, finance & accounting and in most of the reports where there are more factual data in the report. Surprisingly we always gets confused about the difference between SUB-TOTAL and SUBTOTAL & SUMMARIZE and RECOMPUTE. Now lets see what is the differences in between these:

SUB-TOTAL and SUBTOTAL:
1) You can use the SUBTOTAL and SUB-TOTAL commands to sum individual values, such as columns of numbers, each time a named sort field changes value. 
2) SUB-TOTAL displays a subtotal for all numeric values when the sort field changes value, and for any higher-level sort fields when their values change. 
3) SUBTOTAL displays a subtotal only when the specified sort field changes value. It does not give subtotals for higher-level fields. 
4) Both SUB-TOTAL and SUBTOTAL produce grand totals. You can suppress grand totals using the NOTOTAL command.  
5) The subtotal is calculated every time the sort field value changes or, if WHEN criteria are applied to the sort field, every time the WHEN conditions are met. 
6) When using a SUM or COUNT command with only one sort phrase in the request, SUB-TOTAL and SUBTOTAL produce the same result as the value of the SUM or COUNT command. However, when using a PRINT command with one sort phrase, SUBTOTAL is useful because there can be many values within a sort break. 
7) All SUB-TOTALs display up to and including the point where the sort break occurs, so only the innermost point of subtotaling should be requested. For instance, if the BY fields are
BY AREA
BY PROD_CODE
BY DATE SUB-TOTAL
then, when AREA changes, subtotals are displayed for DATE, PROD_CODE, and AREA on three lines (one under the other). 
If you use a WHERE TOTAL or IF TOTAL test, the display of the sort field value for the subtotal line is suppressed unless PRINTPLUS is ON.
Subtotals display on the next line if the subtotal text does not fit on the line prior to the displayed field columns. 


SUMMARIZE AND RECOMPUTE:
1) You can use the SUMMARIZE and RECOMPUTE commands instead of SUB-TOTAL and SUBTOTAL to recalculate the result of a COMPUTE command. SUMMARIZE is similar to SUB-TOTAL in that it recomputes values at every sort break. RECOMPUTE is similar to SUBTOTAL in that it recalculates only at the specified sort break. 
SUMMARIZE 
Recomputes values at every sort break.
RECOMPUTE 
Recalculates values only at the specified sort break.
2) SUMMARIZE recomputes grand totals for the entire report. If you wish to suppress grand totals, you can include the NOTOTAL command in your request. 

So what we need to use is totally depends on our report requirement. 

Happy Reporting in WebFOCUS!!!
Suggestions and questions are always welcome.

Comments

Popular posts from this blog

IBI WebFOCUS - Functions available and syntax to use

IBI WebFOCUS - Difference (Preference) between Join and Match:

IBI WebFOCUS - Testing and Debugging in WebFOCUS codes