21.01.2013 Views

QlikView Reference Manual.pdf - QlikCommunity - QlikView

QlikView Reference Manual.pdf - QlikCommunity - QlikView

QlikView Reference Manual.pdf - QlikCommunity - QlikView

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

count({$} DISTINCT [Invoice Number])<br />

This expression counts the distinct invoice numbers in the state based on the possible<br />

invoice numbers available in State1.<br />

It is almost, but not quite equivalent to the following expression:<br />

count({$} DISTINCT [Invoice Number])<br />

The difference between the expressions is that in the first one, the possible values on invoice number from<br />

State1 are passed into the default state. In the second expression, the selected values from State1 are passed<br />

into the default state. If the user has not made any invoice number selections in State1, no invoice number<br />

values will be passed into the default state.<br />

Set operators are best used within set modifiers. The following expression finds the intersection of the possible<br />

invoice numbers from State1 and State2 and passes those values into the invoice numbers in the default<br />

state.<br />

Examples:<br />

count({$} DIS-<br />

TINCT [Invoice Number])<br />

The expression to find the intersection of invoice numbers in the state and State1 is:<br />

count({$} DISTINCT<br />

[Invoice Number])<br />

This expression may seem confusing because it uses a state ( in this instance) in both the element<br />

function and a set identifier. Keep in mind that the element function p($) is returning the possible values in<br />

the default state. The set/state identifier {$} is being modified by the result of the element functions. Any<br />

invoice selections currently existing in the default state are being overridden by the values from the intersection<br />

of the element functions.<br />

It should be noted that the above expression is still not completely correct as it fails to synchronize the common<br />

selections between the default state and State1. Below is an expression that will do so:<br />

Examples:<br />

count({$} DISTINCT [Invoice Number])<br />

As before, the <strong>QlikView</strong> Developer can add fields into the modifier to keep selections consistent between<br />

various states.<br />

833

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!