This script is used to export a data model to QVDs. This has been especially common since Binary Load, while available, is not supported in Qlik Sense. So for any multi-tiered app design I will have the data model application export the QVDs and have the front end app consume those through optimized loads.

// ***************************************************************************************************** // ** // ** Data Model To QVD // ** // ***************************************************************************************************** /*******************************************************************************************************     SUBROUTINE:     DataModelToQVD('ExportDirectory'[, DropTablesFlag, 'SkipTable01|SkipTable02|...'])     DESCRIPTION:     Subroutine to export the tables of an app to QVDs.                          Dependencies:    None                                          USAGE:             CALL DataModelToQVD('lib://QVD/Transformed/',1,'Log|CustomersTest|ToggleIsland');          Version Infomation:                  1.0         Initial build.          *******************************************************************************************************/ Sub DataModelToQVD(pExportDir, pDropFlag, pSkipList)          Let vDMQ.Start = Timestamp(Now());     Trace -------------------------------------- DataModelToQVD: Starting ($(vDMQ.Start));          Let vDMQ.DropTables = If(Len('$(pDropFlag)') = 0 OR $(pDropFlag) = 1, 'True()', 'False()');     Let vDMQ.SkipList = Chr(39)&Replace('$(pSkipList)','|',Chr(39)&','&chr(39)) & Chr(39);     Let vDMQ.TableCount = NoOfTables()-1;     For x = $(vDMQ.TableCount) to 0 Step -1                  Let vDMQ.TableName = TableName($(x));                  If WildMatch('$(vDMQ.TableName)',$(vDMQ.SkipList)) > 0 Then                          Trace -------------------------------------- DataModelToQVD: Skipping $(vDMQ.TableName) export;                      Else                          Store $(vDMQ.TableName) into [$(pExportDir)$(vDMQ.TableName).qvd] (qvd);             Trace -------------------------------------- DataModelToQVD: Exporting $(vDMQ.TableName) to QVD;                  EndIf;                               If $(vDMQ.DropTables) Then             Drop Table $(vDMQ.TableName);             Trace -------------------------------------- DataModelToQVD: Dropping $(vDMQ.TableName) table;                      Else             Trace -------------------------------------- DataModelToQVD: Keeping $(vDMQ.TableName) table;         EndIf;     Next x     Let vDMQ.End = Timestamp(Now());     Let vDMQ.Duration = Interval('$(vDMQ.End)'-'$(vDMQ.Start)','hh:mm:ss');     Trace -------------------------------------- DataModelToQVD: Complete ($(vDMQ.End));         Trace -------------------------------------- DataModelToQVD: Duration $(vDMQ.Duration);          pExportDir=;pDropFlag=;pSkipList=;vDMQ.Start=;vDMQ.DropTables=;vDMQ.SkipList=;     vDMQ.TableCount=;vDMQ.TableName=;x=;vDMQ.End=;vDMQ.Duration=;         End Sub;