Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{scrollbar}

----
In many cases, when the user must choose a value for a parameter from a long list, it is convenient to approximate the search in several steps.

In the case studied in this tutorial, we have so far defined a parameter to filter the report for a given salesperson. One way to facilitate the location of the salesperson, is to catalogue him first either as Distributor or Direct Sale.

In this way we could first request the Channel and later on, choose the salesperson from the list of salespeople in that channel 

This section explains how to establish this dependence between parameters through *Cascading Parameters*.  

h3. Creating Cascading Parameters

{note:title=Nota}

Se recomienda haber leido antes la sección [Simple Parameterizing]
{note}
# Create a Data Set to build the list of channels.
| *Name*: | Channels |
| *Data Source*: | O3 Local MDX |
| *Data Set Type*: | O3 Data Set |
| *Query* | {code:SQL}
SELECT {[Vendedores].[Canal].members} ON COLUMNS
FROM [Vinos]
{code} |
# Create a Data Set to build the list of Salespeople in each Channel.
| *Name*: | VendedoresDelCanalChannelSalespeople  (ChannelSalespeopleVendedoresDelCanal) \\ |
| *Data Source*: | O3 Local MDX |
| *Data Set Type*: | O3 Data Set |
| *Query* | {code:SQL}
SELECT {[Vendedores].?.children} ON COLUMNS
FROM [Vinos]
{code}
The query mark will be later associated to the parameter that identifies the Channel. \\
Ignore any error message displayed due to not being able to solve the parameter. \\ |
# From the Data Explorer pane right-click on the Report Parameters element.
# Create a new Cascading Parameter 
!NewCascadingParameterPopup.png|vspace=10,hspace=10!
# Enter *Channel Salespeople* (Vendedores Del Canal* (Channel Salespeople) as Parameter name 
# Select *Multiple Data Set*
One Data Set will be used for each step of the parameter ( Data Sets were created before)
!NewCascadingParameterEditorGeneral.png!
# Press the *Add* button to add a parameter to the cascade.
# Enter the following parameters for the first Parameter:  
| *Name:* | Channel |
| *Data Set:* | Channels |
| *Value:* | unique_name |
| *Display Text:* | label |
# Press the *Add* button to add a second parameter to the cascade.
# Enter the following data for the second Parameter.  
| *Name:* | ChannelSalesperson (VendedorDelCanal) |
| *Data Set:* | ChannelSalespeople (VendedoresDelCanal) |
| *Value:* | unique_name |
| *Display Text:* | label |
# The cascading parameter editor should look as shown below.
!NewCascadingParameterFinalSettings.png|vspace=10,hspace=10!
# To continue, press *OK*.

h3. Relating Cascade Parameters 


So far we have defined a Cascade with 2 parameters and 2 Data Sets, one for each parameter in the cascade. 


What is left is to relate parameters so that one acts on the other. 

# Edit the Data Set *ChannelSalespeople* (VendedoresDelCanal)*
# Add a parameter as shown below.
!AddParameterToQueryCascade.png|vspace=10,hspace=10!

h3. Testing what we have done so far.


To test what we have done so far create a new *Data Set * with the following data:


   * *Name*: Sales by Channel and Salesperson 
   * *Data Source*: O3 MDX View
   * *Data Set Type*: O3 Data Set
   * *Query* The following expression in *MDX*:
\\
{code:SQL}
SELECT
	{[Vendedores].?} ON COLUMNS,
	{[Vinos].[Vino].members} ON ROWS
FROM [Vinos]
WHERE Measures.[Litros Vendidos]
{code}\\
\\
{note:title=Nota}
In the query, there is a question mark, indicating that in this place there is a parameter. 


Add the parameter *Salesperson by Channel* (Vendedor Por Canal) in the data set as indicated in  [Simple Parameterizing]
{note}
Create a table with the information of Sales by Channel (Vents por Canal) and Salesperson (Vendedor) as explained in [Designing Report Layout]\\
\\
Select *Preview* and the following screen will appear      
                     !Enter Parameters.png!\\
\\
\\
In *Channel* (Canal) all the channels of salespeople of the *Wines* (Vinos) cube will appear; choose a channel and *Salesperson by Channel* ( Vendedor Por Canal ) will automatically be updated.


In *Salesperson by Channel * all the salespeople in the selected channel will appear; select one salesperson and press OK to see the detail of the litres of wine sold by this salesperson. 
For instance, if you choose "Direct Sale" as channel and Federico Moreira as Salesperson, the report will show:
\\
\\
\\
\|\| Vino \|\| Litros Vendidos \|\|
\\
| Cabernet Sauvignon, Merlot | 4500 |
| Cabernet, Tannat, Merlot | 0 |
| Chenin, Gewurzt | 2250 |
| ... | ... |
| Ugni Blanco | 0 |
 If you wish to change the value of the parameter you will have to click on *Show Report Parameters*  and the previous window will be opened again, where you can choose a new channel and salesperson.


----
{scrollbar}