Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Sometimes the user may wish to reorganise and summarise data in a stream set to get a desired report. The pivot view functionality allows the user to use a stream view attribute's values as the rows against which all other data is reported.

Example 1: Basic Pivot View

  1. Open the stream configuration.
  2. Go to the Views tab.
  3. Create a new view. Choose the 'Pivot' option.
  4. Give the View a name. In this example the view is named Demo Pivot
  5. Leave the Pivot Column Source as 'View Data'.
  6. In the View Attribute pane, insert the attributes you require

Image Modified

In our case we have the attributes already inserted, you can modify the role of an attribute in the pivot view simply by double clicking on an attribute and the following will appear :

Image Modified

In this newly opened View Attribute Configuration Panel, one can modify the details of that attribute, namely one can modify the role it has in that Pivot, the way it aggregates and more importantly the way the Label is used, as it can be used as an Expression, which I will explain further on, in the example.

In the examples bellow, one will see how changing the Pivot Value impacts the way the view behaves.


Image Modified

In this example we can see how the Pivot Value is set for the "Contract Term" and we can easily see which the contract length an account has, emphasised by the True or False values.

Image Modified

To show how the Pivot View changes around the Pivot Value, I have modified the Value to pivot around, and in this case it is now pivoting around when the billing frequency, be it Monthly or just a one time bill.

If by any means we want to sort through the columns we have in here, we will not be able to do so via a Sort Order, instead we will have to change the Pivot Columns Source from "View Data" to "Expression" and now the expression will help sort through the Pivot View.

Image Modified 

Clicking on the Pivot Column Source and we will change the "View Data" option to : 

Image Modified


To correctly set up the column sort the expression must point to the Pivot Column. 

To showcase this we want the pivot view to only display these Column Names in this particular sort order:  Handset , Internet, Voicemail, SIM_Only the expression to be written in the "Pivot Column Expr" field will look like this : ["Handset", "Internet", "Voicemail", "SIM_Only"]

Image Modified


while the Pivot View will look like in the following picture : 

Image Modified

Where the columns "Contract Term", "Charged", "Period", "Match Status", "Quantity" and "Owner" are fixed and the rest of the columns are sorted based on the Pivot Column and Value that we are pivoting around.