The Power of Waterfall Charts

By Nick Zavalkov

Let’s begin with a description of waterfall charts. Waterfall charts are normally used for understanding how an initial value is affected by a series of intermediate positive or negative values. Usually the initial and the final values are represented by whole columns, while the intermediate values are denoted by floating columns.

Now we must understand how WebFOCUS waterfall charts read and interpret Data. Below is sample data that will be plotted as a waterfall chart:

 

As you can see, our initial (or starting) value is for January. Our final value is on August. All other values are called intermediate, and they either add or subtract from the initial value. However, the final value in our example is not the total of intermediate values.

By default WebFOCUS waterfall charts will not represent the final group as a total value, but rather simply treat it as another intermediate step.  We have an option to make the last group be a TOTAL, but we must be very careful how we use this feature. When we do decide to make the last group be TOTAL (or something like “Year to Date”), it will simply ignore all the values in the last group ( August in our example), and it will give the total of values previous to the last group. The following API call will make the last group be a total:
setWaterfallGroupMode(7,2);

The first number in this API call represents the group; in our example the last group is number 7 (8 groups, start at 0). The second number represents the mode that will be plotted.

There are 4 possible modes for each group:

0: Normal, where series risers are stacked on top of each other and each successive series represents the value of its series/group plus any preceding series/group. (This value is the default)

1-Subtotal, which will give a subtotal of groups prior to that group, ignoring all data in that group.

2-Total, which will give a total of groups prior to that group, ignoring all data in that group.

3-Extra, which will simply be represented as a stacked bar. It should only be defined for a last group.

So if the last group is going to be made a total, this is how the data will be interpreted by a waterfall chart:

 

As you can see, the values for the last group, which will be plotted on the Waterfall Chart, are not the same as they were in our original example:


Figure 1

Notice “Year to Date” total is plotted on the last group label, which is August.
We can then rename the last group to be “Year to Date” by the following API call:
setGroupLabel(getGroup(7), "Year To Date");

Figure 2

We also have an option in WebFOCUS waterfall charts to make the last group be simply a stacked bar, which will correctly represent the original data, by the following API call:
setWaterfallGroupMode(7,3);


Figure 3

If, however, we want to see the last group plus the total of all groups, then we would need to recalculate the data and add one more additional group, which will be called “Year to Date:”

And now if we use the option of making the last column a TOTAL (or “Year to Date”), then the waterfall chart will look like this:


Figure 4

In WebFOCUS 7.7.02 we added two new features to waterfall charts:

  1. Make the last group be a total with the following new API call:

setWaterfallLastGroupTotal(true);
Note: this API call acts exactly as setWaterfallGroupMode(7,2); in our example, except there is no need for the user to know which number represents the last group.

  1. Make all the positive values on the Waterfall Chart be represented as green color bars and all the negative values be represented as red color bars:

setWaterfallStackColorMode(true);