diff --git a/Doc/ChangeLog.txt b/Doc/ChangeLog.txt index 1219307..8679511 100644 --- a/Doc/ChangeLog.txt +++ b/Doc/ChangeLog.txt @@ -1,3 +1,10 @@ +Version 11.3 +- This release is a rollup of bug fixes and compatabilty updates for QV12. +- New routine, Qvc.DropTable. Credit to Stanislav Chernov. +- Russian language corrections and various other fixes from Stanislav Chernov. +- Qvc.Calender correction to future date variable from walteryiphk. +- Qvc.DbExtract updated for syntax compatability with QV12. + Version 11.2 - Fixed issue 62, Qvc.IncrementalSetup script error when QVD not exists in QV12.10. - Added new routine, Qvc.ExportTables. diff --git a/Doc/QVC Documentation.qvf b/Doc/QVC Documentation.qvf index fd8143a..2160645 100644 Binary files a/Doc/QVC Documentation.qvf and b/Doc/QVC Documentation.qvf differ diff --git a/Doc/Qlikview Components Release Notes V11.3.pdf b/Doc/Qlikview Components Release Notes V11.3.pdf new file mode 100644 index 0000000..bf0416e Binary files /dev/null and b/Doc/Qlikview Components Release Notes V11.3.pdf differ diff --git a/Doc/Qlikview Components Release Notes.docx b/Doc/Qlikview Components Release Notes.docx index e642165..d1192ac 100644 Binary files a/Doc/Qlikview Components Release Notes.docx and b/Doc/Qlikview Components Release Notes.docx differ diff --git a/Doc/QvcDocumentation.qvw b/Doc/QvcDocumentation.qvw index c4aa146..a3bbe2c 100644 Binary files a/Doc/QvcDocumentation.qvw and b/Doc/QvcDocumentation.qvw differ diff --git a/Examples/DropTable.qvw b/Examples/DropTable.qvw new file mode 100644 index 0000000..1de8b04 Binary files /dev/null and b/Examples/DropTable.qvw differ diff --git a/QVC_Source/Qvc_Global.qvs b/QVC_Source/Qvc_Global.qvs index d488f2f..c73de40 100644 --- a/QVC_Source/Qvc_Global.qvs +++ b/QVC_Source/Qvc_Global.qvs @@ -18,7 +18,7 @@ along with this program. If not, see http://www.gnu.org/licenses/licenses.html ///$tab Global // Qvc.Global.v.Version MUST be specified in the 3 line format to be picked up as an ANT property! SET -Qvc.Global.v.Version = 11.2 +Qvc.Global.v.Version = 11.3 ; LET Qvc.Global.v.ScriptStart = now(1); diff --git a/Qvc_Runtime/Qvc.qvs b/Qvc_Runtime/Qvc.qvs index 2a4a11b..e5296db 100644 --- a/Qvc_Runtime/Qvc.qvs +++ b/Qvc_Runtime/Qvc.qvs @@ -1,4 +1,4 @@ -///$tab License +REM ===== Begin of Qlikview Components included Qvc.qvs version 11.3 =====; /* Copyright (C) 2011 Rob Wunderlich @@ -15,15 +15,15 @@ GNU General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/licenses.html */ -///$tab Global // Qvc.Global.v.Version MUST be specified in the 3 line format to be picked up as an ANT property! SET -Qvc.Global.v.Version = 11.2 +Qvc.Global.v.Version = 11.3 ; LET Qvc.Global.v.ScriptStart = now(1); // Set Qlik product Build Number -LET Qvc.Global.v.QlikBuild = subfield(QlikViewVersion(),'.',3);///$tab AsOfTable +LET Qvc.Global.v.QlikBuild = subfield(QlikViewVersion(),'.',3); + // Name of the optional script file that defines additonal AsOfTable fields. SET Qvc.Calendar.v.ExtFields=AsOfTableExtFields.qvs; SUB Qvc.AsOfTable (_dateField) @@ -91,7 +91,7 @@ DROP TABLE _qvctemp.AsOfTable.Format.Dummy; // Cleanup temp vars ENDSUB -///$tab Calendar Configuration + REM Cleanup any leftover include variables. They cause problems in Sense; SET _qvctemp.v.Include.ExtFields=; SET _qvctemp.v.Include.ExtSetVariables=; @@ -116,7 +116,6 @@ SET Qvc.Calendar.v.ExtFields=CalendarExtFields.qvs; // Name of the optional script file that defines additonal Calendar Set Variables. SET Qvc.Calendar.v.ExtSetVariables=CalendarExtSetVariables.qvs; -///$tab Calendar SUB Qvc.Calendar(_startDate, _endDate, _tableName, _fieldPrefix, _firstMonth) /** @source Qvc_Calendar.qvs @@ -278,7 +277,6 @@ SET _qvctemp.v.Include.ExtFields=; SET __qvctemp.vToday=; -///$tab Calendar Set Variables IF $(Qvc.Calendar.v.CreateSetVariables) THEN // If SA variables requested, // Mapping table that will be used to translate escaped special chars @@ -536,7 +534,6 @@ SET _qvctemp.v.Include.ExtSetVariables=; ENDIF // End of Generating Calendar Set Variables -///$tab Calendar Cleanup // Cleanup temp variables SET _fDate=; SET _fDay=; @@ -558,7 +555,6 @@ SET _monthOffset =; END SUB // End of Qvc.Calendar Sub -///$tab CalendarFromField SUB Qvc.CalendarFromField(_fieldname, _tableName, _fieldPrefix, _firstMonth) /** @source Qvc_Calendar.qvs @@ -594,7 +590,7 @@ SET _vStats.Max=; END SUB // End of Qvc.CalendarFromField Sub -///$tab Cleanup + SUB Qvc.Cleanup /** @source Qvc_Cleanup.qvs @@ -660,7 +656,7 @@ LET Qvc.Global.v.ScriptDuration = now(1) - Qvc.Global.v.ScriptStart; END SUB -///$tab LoadColorTheme + SUB Qvc.ColorTheme (_themeFile, _permColorTable) /** @source Qvc_ColorTheme.qvs @@ -734,7 +730,7 @@ SET _qvctemp.varname=; END SUB -///$tab DataLineage + SUB Qvc.DataLineage (_qvwpath) /** @source Qvc_DataLineage.qvs @@ -910,7 +906,7 @@ SET _qvctemp.SaveErrorMode=; END SUB // Qvc.DataLineage -///$tab Config Vars + // Variables - may be overidden by individual Loader qvw. // The Directory where Connection String Files are kept @@ -918,7 +914,6 @@ SET Qvc.Loader.v.ConnectionDir=.; // Should we create ExtractTimestamp field, true or false. SET Qvc.Loader.v.CreateExtractTimestampField=0; -///$tab DbExtract SUB Qvc.DbExtract (_extractList) REM Start of SUB _Qvc.DbExtract; /** @@ -999,7 +994,6 @@ SET _qvctemp.dbe.listIndex=; REM End of SUB _Qvc.DbExtract; END SUB -///$tab DbExtract_NextTable SUB _Qvc.DbExtract_NextTable (_qvctemp.den.extractList, _qvctemp.den._listIndex) REM Start of SUB _Qvc.DbExtract_NextTable; //================================================= @@ -1290,7 +1284,30 @@ SET _qvctemp.den.vNoOfRows=; REM End of SUB _Qvc.DbExtract_NextTable; END SUB -///$tab EmptyQvd + +SUB Qvc.DropTable (_qvctemp.tablename) +/** +@source Qvc_DropTable.qvs +Drop table if it exists. +Not need to make any checks before drop table. +- if noofrows('tab') > 0 then drop end if +- if tablenumber('tab') > 0 then drop end if +- etc... + +@syntax CALL Qvc.DropTable('tablename'); + +@param 1 String. The table name +*/ +// Check table exists +IF NOT ISNULL (TableNumber('$(_qvctemp.tablename)')) THEN + // If not null then table exist, drop it + DROP TABLE '$(_qvctemp.tablename)'; +END IF + +SET _qvctemp.tablename=; //Delete variable + +END SUB + SUB Qvc.EmptyQvd (_qvctemp.qvdname) /** @source Qvc_EmptyQvd.qvs @@ -1317,7 +1334,7 @@ END IF SET _qvctemp.qvdname=; //Delete variable END SUB -///$tab Error Handling + SET Qvc.Error.v.TerminatingLevel=Qvc.Log.v.Level.ERROR; // Default level for termination SUB _Qvc.Error (_errorLevel, _errormsg) @@ -1350,7 +1367,7 @@ ENDIF END SUB -///$tab ExpandInterval + LET Qvc.ExpandInterval.v.RangeCeiling = num(today(1)); // Default for how high to generate a range SUB Qvc.ExpandInterval (_vRangeTable, _vStartDateField, _vEndDateField, _vGrouping, _vStep) /** @@ -1484,7 +1501,7 @@ SET _qvctemp.Interval=; SET _qvctemp.IntervalFormat=; END SUB -///$tab ExportModel + SUB Qvc.ExportModel (_qvddir, _qvdname, _addTimestamp) /** @source Qvc_ExportModel.qvs @@ -1551,7 +1568,6 @@ SET _qvctemp.qvdname=; SET _qvctemp.addTimestamp=; END SUB -///$tab ImportModel SUB Qvc.ImportModel (_modelQvd) /** @source Qvc_ExportModel.qvs @@ -1582,7 +1598,7 @@ NEXT _qvctemp.tableidx DROP TABLE _qvctemp.TempTableNames; -END SUB///$tab ExportTables +END SUB SUB Qvc.ExportTables (_outputDir, _format, _filter) /** @source Qvc_ExportTables.qvs @@ -1647,32 +1663,7 @@ SET _qvctemp.format=; SET _qvctemp.ext=; END SUB -///$tab License -/* -Copyright (C) 2011 Rob Wunderlich -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this program. If not, see http://www.gnu.org/licenses/licenses.html -*/ -///$tab Global -// Qvc.Global.v.Version MUST be specified in the 3 line format to be picked up as an ANT property! -SET -Qvc.Global.v.Version = 11.2 -; -LET Qvc.Global.v.ScriptStart = now(1); - -// Set Qlik product Build Number -LET Qvc.Global.v.QlikBuild = subfield(QlikViewVersion(),'.',3);///$tab Icons // Config variables for Qvc.Icons SET Qvc.Icons.v.Capitalize.ImageName = -1; SUB Qvc.Icons (_dir, _mask, _fileTypes, _tableName, _fieldName) @@ -1746,7 +1737,7 @@ SET _qvctemp.ext=; SET _qvctemp.img=; SET _qvctemp.currImgName=; -END SUB///$tab Config Vars +END SUB // Variables - may be overidden by individual Loader qvw. // Datetime literal format for DB (MS SQL Server) @@ -1780,7 +1771,6 @@ SET Qvc.Loader.v.StoreMaxModFieldValue = 0; // If true, the value after the "." will be taken as the QVD fieldname. // If false, the modfield name will remain unchanged and assumed that modfield = QVD Fieldname. SET Qvc.Loader.v.QualifiedModfield = -1; -///$tab Incremental Setup SUB Qvc.IncrementalSetup (_vTablename, _vSqlModField, _vPk, _vForceFullReload) /** @source Qvc_Incremental_Reload.qvs @@ -1927,7 +1917,6 @@ SET _Qvc.Loader.v.Predicate.SFDC.Revision=; END SUB; // End of IncrementalSetup sub -///$tab Incremental Store SUB Qvc.IncrementalStore (_vDbKeyTable) /** @source Qvc_Incremental_Reload.qvs @@ -1985,7 +1974,6 @@ SET _vTimestampMask=; SET _vPrimaryKey=; END SUB // End of IncrementalStore sub -///$tab UpdateQvd SUB Qvc.UpdateQvd (_vTablename, _vQvdFile, _vPrimaryKey, _vDbKeyTable, _vReplaceQvd) /** @source Qvc_Incremental_Reload.qvs @@ -2103,7 +2091,7 @@ SET _Qvc.Loader.v.ForceFullReload=; END SUB // End of Qvc.UpdateQvd Sub -///$tab InspectTable + SUB Qvc.InspectTable (_tableName) /** @@ -2155,7 +2143,7 @@ SET _qvctemp.tempQvdPath=; // Clean temp variable SET _qvctemp.Qvc.v.QvdViewer.Path=; END SUB -///$tab JoinGeneric + SUB Qvc.JoinGenericTables (_targetTable, _genericTables) /** @source Qvc_JoinGenericTables.qvs @@ -2188,7 +2176,7 @@ SET _qvctemp.vTable=; END SUB -///$tab LinkTable + SUB Qvc.LinkTable (_linkTableName, _table, _fields) /** @source Qvc_LinkTable.qvs @@ -2234,7 +2222,7 @@ SET _LinkTableTemp=; SET _vId=; END SUB -///$tab ListFiles + SUB Qvc.ListDirectories (dir, mask, subdirectories, callback) /** @source Qvc_ListDirectories.qvs @@ -2290,7 +2278,7 @@ FOR EACH _qvctemp.dir in DirList('$(dir)$(mask)'); NEXT _qvctemp.dir; END SUB -///$tab ListFiles + SUB Qvc.ListFiles (dir, mask, subdirectories, callback) /** @source Qvc_ListFiles.qvs @@ -2339,7 +2327,7 @@ SET _subdir=; END SUB -///$tab Main + /* Logging subroutine */ REM Default configuration for Qvc.Log; @@ -2460,7 +2448,6 @@ Writes an warning level message to the Qvc.Log. Convienence sub that calls Qvc.L */ CALL Qvc.Log(_msg, '$(Qvc.Log.v.Level.WARNING)'); END SUB -///$tab Log Utility /* @Function _Qvc.Log.LevelNumber @source Qvc_Log.qvs @@ -2475,7 +2462,7 @@ SET _Qvc.Log.LevelNumber = wildmatch('$1','$(Qvc.Log.v.Level.INFO)', '$(Qvc.Log. @EndFunction */ -///$tab PopulateVariables + SUB Qvc.PopulateVariables (_vartable, _useLET) /** @source Qvc_PopulateVariables.qvs @@ -2519,7 +2506,7 @@ SET _qvctemp.varvalue=; END SUB -///$tab Main + SUB Qvc.QvcAvailableUpdate (_retvar) /** @source Qvc_QvcAvailableUpdate.qvs @@ -2544,7 +2531,7 @@ LET _retvar = if(peek('_qvctemp.DownloadableQvcVersion') > '$(Qvc.Global.v.Versi DROP TABLE _qvctemp.QvcAvailableUpdate; -END SUB///$tab EmptyQvd +END SUB SUB Qvc.SegmentedStore (_qvctemp.tableName, _qvctemp.dateFieldName, _qvctemp.storePath, _qvctemp.qvdBaseName, _qvctemp.segmentType, _qvctemp.segmentsPerFile) /** @source Qvc_SegmentedStore.qvs @@ -2587,24 +2574,24 @@ DROP TABLE _qvctemp._tempDatesTable; // Set initial value for loop variable to start of interval based on min available date IF lower('$(_qvctemp.segmentType)') = 'month' THEN - LET _qvctemp.currMinDate = num(monthstart(_qvctemp.minDate)); + LET _qvctemp.currMinDate = num(monthstart(_qvctemp.minDate), '0.0', '.', ''); ELSEIF lower('$(_qvctemp.segmentType)') = 'week' THEN - LET _qvctemp.currMinDate = num(weekstart(_qvctemp.minDate)); + LET _qvctemp.currMinDate = num(weekstart(_qvctemp.minDate), '0.0', '.', ''); ELSEIF lower('$(_qvctemp.segmentType)') = 'day' THEN - LET _qvctemp.currMinDate = num(daystart(_qvctemp.minDate)); + LET _qvctemp.currMinDate = num(daystart(_qvctemp.minDate), '0.0', '.', ''); END IF // Loop through table a period at a time DO WHILE _qvctemp.currMinDate <= _qvctemp.maxDate // Set the max date for this loop iteration IF lower(_qvctemp.segmentType) = 'month' THEN - LET _qvctemp.currMaxDate = num(monthend(addmonths(_qvctemp.currMinDate, $(_qvctemp.segmentsPerFile))-1)); + LET _qvctemp.currMaxDate = num(monthend(addmonths(_qvctemp.currMinDate, $(_qvctemp.segmentsPerFile))-1), '0.0', '.', ''); LET _qvctemp.currFileName = '$(_qvctemp.qvdBaseName)_' & date($(_qvctemp.currMinDate), 'YYYY_MM') & '.qvd'; ELSEIF lower(_qvctemp.segmentType) = 'week' THEN - LET _qvctemp.currMaxDate = num(weekend(_qvctemp.currMinDate + (7 * $(_qvctemp.segmentsPerFile)) - 1)); + LET _qvctemp.currMaxDate = num(weekend(_qvctemp.currMinDate + (7 * $(_qvctemp.segmentsPerFile)) - 1), '0.0', '.', ''); LET _qvctemp.currFileName = '$(_qvctemp.qvdBaseName)_' & date($(_qvctemp.currMinDate), 'YYYY_MM_DD') & '.qvd'; ELSEIF lower(_qvctemp.segmentType) = 'day' THEN - LET _qvctemp.currMaxDate = num(dayend(_qvctemp.currMinDate + $(_qvctemp.segmentsPerFile) - 1)); + LET _qvctemp.currMaxDate = num(dayend(_qvctemp.currMinDate + $(_qvctemp.segmentsPerFile) - 1), '0.0', '.', ''); LET _qvctemp.currFileName = '$(_qvctemp.qvdBaseName)_' & date($(_qvctemp.currMinDate), 'YYYY_MM_DD') & '.qvd'; END IF @@ -2637,7 +2624,7 @@ SET _qvctemp.currFileName=; END SUB -///$tab TableStats + SUB Qvc.TableStats (_msg, _tableIncludeList) /** @source Qvc_TableStats.qvs @@ -2697,7 +2684,7 @@ SET _msg=; SET _qvctemp.counter=; END SUB -///$tab GetFieldValue + SUB Qvc.GetFieldValues (_retvar, _field, _vTable) /** @source Qvc_Utility.qvs @@ -2737,7 +2724,6 @@ DROP table _qvctemp.temptab; SET _vSource=; END SUB -///$tab FileExists /** @Function Qvc.FileExists @source Qvc_Utility.qvs @@ -2751,7 +2737,6 @@ SET Qvc.FileExists = if(len(FileSize($1)) > 0, -1, 0); /* @EndFunction */ -///$tab DefaultIfEmpty /** @Function _Qvc.DefaultIfEmpty @source Qvc_Utility.qvs @@ -2766,7 +2751,6 @@ SET _Qvc.DefaultIfEmpty = if(len('$1')= 0,'$2', '$1'); /* @EndFunction */ -///$tab UniqueId SET _Qvc.UniqueId.v.Counter=0; SUB _Qvc.UniqueId (_retvar) /** @@ -2779,7 +2763,6 @@ Returns a unique identifier on each call. LET $(_retvar) = 'UID' & num($(_Qvc.UniqueId.v.Counter), '00000000'); END SUB -///$tab FieldContains /** @Function Qvc.FieldContains @source Qvc_Utility.qvs @@ -2795,7 +2778,6 @@ SET Qvc.FieldContains = sum(if($1=$2,1))>0; @EndFunction */ -///$tab TableExists /** @Function _Qvc.TableExists @source Qvc_Utility.qvs @@ -2810,7 +2792,6 @@ SET _Qvc.TableExists = len(NoOfRows('$1'))>0; @EndFunction */ -///$tab DateDiff /** @Function Qvc.DateDiff @source Qvc_Utility.qvs @@ -2836,7 +2817,6 @@ SET Qvc.DateDiff = if(lower($1)='year', year($3) - year($2) @EndFunction */ -///$tab NVL /** @Function Qvc.NVL @source Qvc_Utility.qvs @@ -2851,7 +2831,6 @@ SET Qvc.NVL = if(isnull($1), $2, $1); @EndFunction */ -///$tab Days360 /** @Function Qvc.Days360 @source Qvc_Utility.qvs @@ -2870,7 +2849,6 @@ SET Qvc.Days360 = (((year($2)*12 + month($2)) - (year($1)*12 + month($1))) * 30) @EndFunction */ -///$tab InRange /** @Function Qvc.InRange @source Qvc_Utility.qvs @@ -2886,7 +2864,6 @@ SET Qvc.InRange = if($1<$2, if($3>=$1 AND $3<=$2, -1, 0), if($3>=$2 AND $3<=$1, @EndFunction */ -///$tab QvdFieldNumber SUB Qvc.QvdFieldNumber (_qvctemp.fieldname, _qvctemp.qvdname, _qvctemp.retvar) /** @source Qvc_Utility.qvs @@ -2924,7 +2901,7 @@ NEXT _qvctemp.idx SET _qvctemp.idx=; // Delete temp variable END SUB -///$tab Main + SUB Qvc.CreateWildMapExpression (_expressionVar, _table) /** @source Qvc_WildMap.qvs @@ -2959,4 +2936,6 @@ SET _MapKeyField=; SET _MapValueField=; END SUB -/* * End of Qvc.CreateWildMapExpression subroutine * */ \ No newline at end of file +/* * End of Qvc.CreateWildMapExpression subroutine * */ + +REM ===== End of Qlikview Components included Qvc.qvs version 11.3 =====;