Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
We are using Qlik Colud and have a MS SQL data source where MS SQL native Change Tracking (CT) is enabled on the data base and the tables we need to load.
To utilize the CT functionality (and only load the changed data) we need to run some CT functions. To get the current change tracking version (in MS SQL management studio) you run only SELECT CHANGE_TRACKING_CURRENT_VERSION() which returns the last change tracking version.
We need get this value in Qlik data load editor, but struggle to make this work.
In data load editor we have tried:
LIB CONNECT TO 'DatabaseConnectionName';
Change_Tracking_Version:
LOAD '(no column name)';
SQL
SELECT CHANGE_TRACKING_CURRENT_VERSION();
This returns a table with one line with value '(no column name)'
Do any of you experts know how to do this? Please advise.
I found a solution, I had to alias the function.
I changed the script:
LIB CONNECT TO 'DatabaseConnectionName';
Change_Tracking_Version:
LOAD '(no column name)';
SQL
SELECT CHANGE_TRACKING_CURRENT_VERSION() ct;
And now the load editor returns the value.
Stored Procedure:
CHANGE_TRACKING_CURRENT_VERSION()
.Multiple SQL Statements:
CHANGE_TRACKING_CURRENT_VERSION()
value in a temporary table and join it with your main data query.Qlik Script Variables:
CHANGE_TRACKING_CURRENT_VERSION()
value.