Databases Reference
In-Depth Information
4. Right after the dollar sign, we define the fields that will play the role of
set modifiers, . This is the part in which we specify what to add or exclude
from the initial record set. The entire set of field-value definitions will be
enclosed in angle brackets ( < > ) and the syntax is FieldName = {NewValue} .
Different variations to this syntax are described as follows:
° FieldName = {value} : when the NewValue parameter is a numeric
value, it is specified as such with no additional modifications
° FieldName = {'TextValue'} : when the NewValue parameter is
text, we should enclose it in straight single quotes
° FieldName = {"SearchString"} : if we want to use a search string
as the value definition, we should enclose it in straight double quotes
The value definition can also be a set of different values, in which case each element
is separated by a comma.
We can also refer to the NewValue parameter as
the Element List parameter.
Once we add the set modifiers, our set expression will be complete and have the
following structure (shown as pseudocode for illustration purposes):
Sum({$<Field1 = {NewValue1}, Field2 = {NewValue2}>} [# Departures
Performed])
Taking our base expression as a starting point, here are some examples:
Sum({$<[Carrier Group] = {'Foreign Carriers'}>} [# Departures
Performed])
This will result in the total number of flights performed, but only taking into
account the record set defined by the current selections ( $ ), and where the
Carrier Group field has a value of Foreign Carriers . All other Carrier
Groups are excluded.
In this example, if the user has specifically selected a different value in the
Carrier Group field, that selection will be overridden and the calculation
will be made based on the modified record set. It's important to convey this
fact to the end users of the QlikView document and add pointers in the user
interface as to what each calculation is being based on so that the use of Set
Analysis doesn't negatively affect the user experience.
Sum({$<Year = {2010}>} [# Departures Performed])
This will use a record set based on current selections ( $ ) where the Year is
2010 even if the user selects something else in the Year field.
 
Search WWH ::




Custom Search