Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello experts, I'm new to QLIK. I'm building a dashboard and I have many queries for many indicators that are using the same list of values in the where conditions. I would like to be able to have this list defined in one single place and be able to call this defined list name in every where clause needed without copy pasting every value list.
I've read many things but could not find the solution for that.
I tried things like :
SET vGroupListSample = ('A1','A2','A3')
...
and...
where assignment_group='$(vGroupListSample )' or assignment_group IN '$(vGroupListSample )' but it does not work or gives 0. Could you please help?
Something like this should work fine, assuming you're passing this to an SQL query using IN.
I confirmed that this works with both A1 (returns one row) and A4 (returns no rows) querying MS-SQL.
SET vGroupListSample = ('A1','A2','A3');
SELECT * FROM (
SELECT 'A4' as Field) A
Where A.Field IN $(vGroupListSample) ;
Something like this should work fine, assuming you're passing this to an SQL query using IN.
I confirmed that this works with both A1 (returns one row) and A4 (returns no rows) querying MS-SQL.
SET vGroupListSample = ('A1','A2','A3');
SELECT * FROM (
SELECT 'A4' as Field) A
Where A.Field IN $(vGroupListSample) ;
I was missing the "A".Field in the where condition and single quotes were not needed. Thanks!