Академический Документы
Профессиональный Документы
Культура Документы
MLT Vacations
Problem
Our goal here is to analyze specific flight patterns and compare the
current numbers to the previous year.
We will define our criteria using QlikView selections. Selections work well
in this situation, because they are easy to use within Set Analysis and
allow our users the flexibility to modify the criteria on-the-fly.
Due to the structure of our data, simply making the selections will not be
enough to get us the answers we are looking for. Our dataset
contains multiple records for each booking, one record for each
activity the customer will do during their trip. Bookings can also
include multiple customers, so we’ll have to verify that each booking
and customer we include matches the criteria.
Since the specific flight pattern we are looking for will only match one
record, we’ll need to include any customer where at least one record
matches our selected criteria.
Data
Here is the basic syntax for a Set Analysis expression and some terms I
will use throughout the presentation.
Sum(AirRev)
Using Set Analysis and the 1 modifier, we will ignore all selections:
Sum({1} AirRev)
We will bring our selections back in to play by utilizing the P() function
Sum({1} AirRev)
We add a Set Expression to the P() function to define the date span
Sum({1<BkgCust=P(
{<DeptDate={}>}
BkgCust)>} AirRev)
Adding a Previous Year Expression
We add a Set Expression to the P() function to define the date span
Sum({1<BkgCust=P(
{<DeptDate={}>}
BkgCust)>} AirRev)
Sum({1<BkgCust=P(
{<DeptDate={‘>=7/1/2010<=12/31/2010’}>}
BkgCust)>} AirRev)
Our current year span will be defined by a selection, we will use this
selection to define the previous year span
Our current year span will be defined by a selection, we will use this
selection to define the previous year span
Our current year span will be defined by a selection, we will use this
selection to define the previous year span
$(=AddYears(Min(DeptDate),-1))
$(=AddYears(Min(DeptDate),-1))
Adding the Functions Using Dollar Sign Expansions
$(=AddYears(Min(DeptDate),-1))
$(=AddYears(Min(DeptDate),-1))
{‘>= 7/1/2010
<= 12/31/2010 ’}
Adding the Functions Using Dollar Sign Expansions
$(=AddYears(Min(DeptDate),-1))
$(=AddYears(Min(DeptDate),-1))
{‘>=$(=AddYears(Min(DeptDate),-1))
<=$(=AddYears(Min(DeptDate),-1))’}
Tip: Dollar Sign Expansions in Set Expressions
When building Set Expressions with Dollar Sign Expansions, put your
expression into a Straight Table, but don’t give the expression a label
When the chart is rendered, the label will be your Set Expression with
the Dollar Sign Expansion evaluated
Sum({<DeptDate=
{‘>=$(=AddYears(Min(DeptDate),-1))
<=$(=AddYears(Min(DeptDate),-1))’}>}
AirRev)
Final Expressions
We now have working expressions for our selected date span and for the
previous year. These expressions can be used in tables or charts.
Since they are dynamic based on a selection, they can be modified
by the user on-the-fly
Sum({1<BkgCust=P(BkgCust)>} AirRev)
Sum({1<BkgCust=P({<DeptDate=
{‘>=$(=AddYears(Min(DeptDate),-1))
<=$(=AddYears(Min(DeptDate),-1))’}
BkgCust)>} AirRev)
We now have working expressions for our selected date span and for the
previous year. These expressions can be used in tables or charts.
Since they are dynamic based on a selection, they can be modified
by the user on-the-fly
Sum($(vSA) AirRev)
Sum($(vSA_LY) AirRev)
Charting our Expressions
Here are some things to remember as you build your own expressions