Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Highlighted
Silver Contributor
Posts: 835
Registered: ‎03-24-2009

Qlik View Incremental Load of ALL SLX Tables to QVD files script

You'll need to download QVC (Qlik View Components) from QV Guru Rob Wunderlich. I use this script to generate the BASE SLX Data incrementally.....then another and similar script to generate the TRANSFORMED QVD files (also on an incremental basis) with the fields actually desired for each table (like Account_City, Account_State, Account_ManagerName....).

 

This works great on QV 11...

 

// Load/Store as QVD files:
// All SalesLogix tables
// June 3, 2013 RJ Samp


// Added Deepak Vadithala's For Next Loop to read all SLX ResynchTableDefs TableNames.
// Added Rob Wunderlich's QVC Incremental QVD Loader scripts to incrementally load all QVD tables\files.
// ======================================================//

SubLoadTableNames
SQLTableList:
LOAD
TABLENAMEASTableNames,
KEYFIELDasKeyFields,
DATESTAMPFIELDasDateStampFields;

Sql
SELECT
TABLENAME, KEYFIELD, DATESTAMPFIELD
FROM
sysdba.RESYNCTABLEDEFS
WHERE
ISNULL(KEYFIELD, '') > '' AND ISNULL(DATESTAMPFIELD, '') > ''
ORDER BY TABLENAME ;
EndSub;

// ======================================================//

CallLoadTableNames;

// ======================================================//

LetvTableCount = NoOfRows('SQLTableList') - 1;

// ======================================================//

SubLoadTableData
Fori = 0 To$(vTableCount)
LETvMyTableName = Peek('TableNames', $(i), 'SQLTableList');
LETvMyBaseTableName = '$(vMyTableName)'  & '_BASE';
LETvMyPrimaryKeyFieldName = Peek('KeyFields', $(i), 'SQLTableList');
LETvMyUpdateColumnFieldName = Peek('DateStampFields', $(i), 'SQLTableList');
//STORE $(vMyTableName) INTO $(Directory)$(vMyTableName).QVD;
//DROP Table $(vMyTableName);
// Calling parameters are QVTablename, UpdateColumn, PrimaryKey.
CALLQvc.IncrementalSetup ('$(vMyBaseTableName)', '$(vMyUpdateColumnFieldName)', '$(vMyPrimaryKeyFieldName)' ); 

// v.Tablename is set by IncrementalSetup
[$(Qvc.Loader.v.Tablename)]:
// Whatever LOAD and SELECT goes here
SQL SELECT * FROM sysdba.$(vMyTableName)
// v.IncrementalExpression is set by IncrementalSetup
WHERE $(Qvc.Loader.v.IncrementalExpression) ;
// Update the QVD with the changed rows
CALLQvc.IncrementalStore;

Nexti

EndSub;

// ==========================================================================================//

CallLoadTableData;

// ==========================================================================================//

CALLQvc.Cleanup;

RJ Samp