tag:blogger.com,1999:blog-3174073825360154810.post6838363073883163..comments2022-12-06T05:49:47.306-05:00Comments on QlikView Maven: Archive Data-TBhttp://www.blogger.com/profile/08386812862574514289noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-3174073825360154810.post-77444828660671123412009-02-24T08:34:00.000-05:002009-02-24T08:34:00.000-05:00Hi, TimSometimes you need to save QV document with...Hi, Tim<BR/><BR/>Sometimes you need to save QV document without data (to save disk space). As QV does don't have metada management nor version control, I created miniscript to load, reduce QV document and put new "empty" QV document into new folder. I scheduled this script before everyday QV docs reload. All my QV document takes 30 GB, and "empty" QV document takes 0.5 GB for 3 months. There is the script:<BR/><BR/>Set objFSO = CreateObject("Scripting.FileSystemObject")<BR/>Set objFolders = objFSO.GetFolder("z:\vitrinos\")<BR/> <BR/>FindFileR objFolders<BR/> <BR/>Sub FindFileR(ByRef objFolders)<BR/> <BR/> Set objSubFolders = objFolders.SubFolders<BR/> Set objFiles = objFolders.Files<BR/> <BR/> for each File in objFiles<BR/> If Right(File.Name, 4) = ".qvw" Then<BR/> ReduceData File.Path, File.Name<BR/> End If<BR/> Next<BR/> <BR/> for each Folder in objSubFolders<BR/> FindFileR Folder<BR/> Next<BR/> <BR/> Set objSubFolders = Nothing<BR/> Set objFiles = Nothing<BR/> <BR/>end Sub<BR/><BR/><BR/>Sub ReduceData (FilePath, FileName)<BR/><BR/><BR/> Set qlik = CreateObject("QlikTech.QlikView")<BR/> Dim NewFileName<BR/> NewFileName = "C:\sql_scripts\QV Daily\" & Year(Now) & Right("0" & Month(Now), 2) & Right("0" & Day(Now), 2) & "_" & Replace(FileName, ".qvw", "") & "_" & Replace(Replace(Replace (FilePath, FileName, ""), "\", "_"), ":", "_") & ".qvw"<BR/><BR/> If objFSO.FileExists (NewFileName) Then<BR/> objFSO.DeleteFile (NewFileName)<BR/> End If<BR/><BR/> Set Doc = qlik.OpenDoc(FilePath)<BR/> Doc.RemoveAllData<BR/> Doc.SaveAs NewFileName <BR/> Doc.CloseDoc<BR/><BR/> qlik.Quit<BR/> Set qlik = Nothing<BR/><BR/>End SubRamunas Balukonishttps://www.blogger.com/profile/15785909700834448153noreply@blogger.comtag:blogger.com,1999:blog-3174073825360154810.post-54695547986455913492009-01-31T22:28:00.000-05:002009-01-31T22:28:00.000-05:00Hi Arun,This posting is not so much about a specif...Hi Arun,<BR/>This posting is not so much about a specific technical solution as about a project management or architecture choice.<BR/><BR/>Here's the key thought:<BR/>If your project has a requirement to periodically save data simply so that it can be examined some time in the future if it is needed; then consider saving the data in a QlikView document instead of some special backup or technical archive technique such as database dump files.-TBhttps://www.blogger.com/profile/08386812862574514289noreply@blogger.comtag:blogger.com,1999:blog-3174073825360154810.post-9903412252652408022009-01-27T04:41:00.000-05:002009-01-27T04:41:00.000-05:00an example pls to show how to do it..thnx - Arun M...an example pls to show how to do it..thnx - Arun MittalAnonymousnoreply@blogger.com