Introduction to Pivot Widget
This document describes use of value column list in pivot table. This option is available on selected rows and columns in pivot table. User can change this by clicking on setting icon available on just right side of selected row or column.
It is assumed that user has knowledge of using events with pivot and passing column or row value by event. When you click on setting icon of selected row or column, by default in value list column or row name is selected. So, when user write event to pass row or column name on click it will pass selected row or column value on which user clicked. Let’s understand this by example and let’s create event in pivot which pass clicked row or column value and filter table data in next tab.
- Login to AIV and create new dashboard
- Create pivot table which has following fields:
Rows: productLine
Columns: Year
Values: Extendedprice [sum]
- To add event, click on setting icon near productline column,
- Once clicked, several options will be displayed as below,
- In above screenshot you can see productLine is selected in Value list
- To add script, click on script checkbox and script space will be added under script checkbox as below,
- In this script box, writing script to take column productline value, go to next tab and filter table.
- Sample script used here is below,
- Script description as follows;
1. Is selected column name
2. Tab ID on which I want to switch
3. Event for tab change
4. Filter name which will be created in 2nd tab for filtering table
5. Event to call filter
- Save changes
- Create a new tab and add table widget there with sales dataset
- Create filter as same name as provided in event step number 4. keep filter on “on change”
- Link filter with productline of table widget and add it in dashboard
- Check this event is working fine by clicking on any product line in pivot table
- By doing so, it will take you to tab 2 and table data is filtered with product line you have clicked.
- In previous case whatever product line we are clicking is passing to next tab because in value list by default product line column is selected.
- If user want to pass some other column data associated with this product line, value list came in to picture. For example, if I want to pass country name associated with clicked product line then we use country in value drop down list.
- NOTE: Value column we are passing instead of product line should have unique value for that product line. I.e., there should be only one unique country for each product line
- To make country unique I am passing country parameter and using USA as default parameter so that all product line has only one country value. (For demonstration only)
- Go to pivot, edit widget and click on setting icon to open settings
- From value drop down we are selecting country column
- This means now when we click on any product line name it will pass associated country name which is USA in this example.
- Now we have linked filter in tab 2 with product line earlier but now we are passing country name.
- So, change filter settings accordingly with country column this time
- Save changes and go to preview mode
- Now by default country name is USA so click on any product line and it will take now country value and pass it to next tab filter.
- So now table widget will filter with country USA.