Dynamic titles with totals

You've likely noticed the titles that are displayed for every view. There are also captions that are not shown unless you specifically turn them on (to do this, select Worksheet | Show Caption from the menu).

By default, the title displays the sheet name and captions are hidden, but you can show and modify each. At times, you might want to display totals that help your end users understand the broad context or immediately grasp the magnitude.

Here, for example, is a view that allows the user to select one or more Region and then see Sales per State in each Region:

It might be useful to show a changing number of states as the user selects different regions. You might first think to use an aggregation on State, such as Count Distinct. However, if you try showing that in the Title, you will always see the value 1. Why? Because the view level of detail is State and the distinct count of states per state is 1!

But there are some options with Table Calculations that let you further aggregate aggregates. Or, you might think of determining the number of values in the table based on the size of the window. In fact, here are several possibilities:

  • To get the total distinct count: TOTAL(COUNTD([State]))
  • To get the sum within the window: WINDOW_SUM(SUM(1))
  • To get the size of the window: SIZE()

You may recall that a window is defined as the boundaries determined by Scope or Partition. Whichever possibility we choose, we want to define the window as the entire table. Either a relative computation of Table Down or a fixed computation using all of the dimensions would accomplish this. Here is a view that illustrates a dynamic title and all three options in the caption:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.119.106