Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
HimanshuKakade
New Contributor

QlikView Variable in Where Clause in Direct Query

We have a hybrid approach while loading a data. i.e. one table is in memory and the other is Direct Query. 

Below is the script.

InMemoryTable:
LOAD Country as Country1;
SQL SELECT DISTINCT Country FROM EmployeeVw;

DirectQueryTable:
DIRECT QUERY
DIMENSION
[EMPID]
,[BusinessType]
,[Year]
,[CompanyName]
,[FullName]
,[Country]
,[Region]
,[Contact]

MEASURE
[Revenue]
,[Sales]
,[Profit]

FROM EmployeeVw;

 

on UI, we have a chart showing Profit by Country & a listbox Country1 (note that this column belongs to the inmemory table) . We need to build the dashboard in such a way that once a value in Country1 is selected from the listbox, only then a table will appear and show the data for that Country. We are thinking to create a variable (vCountry) that will hold the value for GetFieldSelections(Country1)

We want to put hat variable at the where clause at the end of our Direct Data Query like below.

FROM EmployeeVw Where Country = '$(vCountry)';

 

When we tried that we observed that the variable value is not being passed to the direct query and hence the data from the direct query is not filtering as per the requirement.

Can someone please suggest us a solution to this issue and how we can achieve passing a QlikView variable in the  Where clause of the Direct Query?