Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
I've the following sql select:
select FIELD1, FIELD2, FIELD3 from MYTABLE where project_id in ('AAA', 'BBB', 'CCC')
I would change it this way
SELECT FIELD1, FIELD2, FIELD3 from MYTABLE where poject_id in ('$(var_paramters)')
but I don't know the right way to build var_parameters
Help please
Thanks in advance
Israr
I do not agree with reply above.
I routinely use SQL which exploits adding in text to the SQL command using QlikView variables as Krishna suggests, especially for incremental loads.
Have a look at the load script in the qvw attached to this document Incremental_Load.qvw
Best Regards, Bill
Try the following:
Set var_parameters = 'AAA', 'BBB', 'CCC';
SELECT FIELD1, FIELD2, FIELD3 from MYTABLE where poject_id in ($(var_paramters));
($(var_paramters)) ITS A QLIKVIEW syntax, You cant use it in select statement.
first load all record from sql like the script below:
SELECT FIELD1, FIELD2, FIELD3 from MYTABLE;
the do the preceding load of qlikview like below:
Set var_parameters = 'AAA', 'BBB', 'CCC';
SELECT FIELD1, FIELD2, FIELD3 from MYTABLE where poject_id in ($(var_paramters));
final script will look like below:
....................
Set var_parameters = 'AAA', 'BBB', 'CCC';
Load FIELD1, FIELD2, FIELD3 where poject_id in ($(var_paramters));
SQL SELECT FIELD1, FIELD2, FIELD3 from MYTABLE;
Israr
I do not agree with reply above.
I routinely use SQL which exploits adding in text to the SQL command using QlikView variables as Krishna suggests, especially for incremental loads.
Have a look at the load script in the qvw attached to this document Incremental_Load.qvw
Best Regards, Bill
Thanks!!