Databases Reference
In-Depth Information
After properly formatting the expressions' values and the chart's presentation, we
will have the following chart:
Awesome!
We can even take this one step further. We previously said that period comparisons
are widely used in almost any QlikView document, but what we've done with the
preceding procedure is define the variables in one document. What about all of the
other documents? Do we need to create each of these variables over and over again
for each of our QlikView documents? Well, let's discuss an alternative.
Portable set expressions
Now that set expressions are handled via variables, we can automate the process of
creating these variables, instead of doing it all manually. We will use an include
statement to create the variables during script execution and by using a text file
shared across different QlikView documents.
To begin, we will create a text file, containing the code used to define each variable.
The contents of our text file will be:
Let vSetYTD = 'PeriodID = {"<=' &Chr(36) & '(=Max(PeriodID))"},'
&Chr(10) &
'Year = {' &Chr(36) & '(=Max(Year))},' &Chr(10) &
'Quarter = ,' &Chr(10) &
'Period = ,' &Chr(10) &
'Month = ';
Let vSetQTD = 'PeriodID = {"<=' &Chr(36) & '(=Max(PeriodID))"},'
&Chr(10) &
'QuarterID = {' &Chr(36) & '(=Max(QuarterID))},' &Chr(10) &
'Year = ,' &Chr(10) &
'Quarter = ,' &Chr(10) &
'Period = ,' &Chr(10) &
 
Search WWH ::




Custom Search