Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Coming Aug. 9: New Simplified Authoring for Qlik Sense SaaS – For Details, CLICK HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Why is my data not storing in QVD properly?

Hello,

Below is the script I'm using. For some reason, the QVD isn't pulling the data properly, could someone explain why that might be happening?

Thanks.

Sub DoDir (Root)  

     For Each Ext In 'csv' // filetype to search for in current directory  

          For Each File In FileList (Root & '\*.' & Ext)  

                   USERS_BY_USB_LIST:  

                    Load

                     if(wildmatch('$(File)', '*Users_*'), '$(File)') as Name1,  

                     if(IsNull(if(wildmatch('$(File)', '*Users_*'), '$(File)')),'Exclude','$(File)') AS FileTest1,

                     FileTime('$(File)') as FileTime1,  

                     FileSize('$(File)') AS FileSize1,

                     RangeSum(Peek('FileCount')) as FileCount1

                     Autogenerate 1;  

          Next File  

     Next Ext  

 

     For Each Dir In DirList (Root & '\*') // search in subdirectories  

          Call DoDir (Dir)  

     Next Dir  

 

End Sub  

 

Call DoDir ('$(vESDDataLocation)$(vUSB)'); // Starting point   

//Exclude the Microsoft Temporary Filesa; Exclude any file name starting with the ~ character

USERS_BY_USB_LIST: 

FIRST 1 LOAD

  Name1 AS File_Name,

  FileTime1 AS File_Time,

  FileCount1   AS File_Count,

  FileSize1 AS File_Size,

  FileTest1   AS File_Test

Resident LIST_ENCRYPTED_FILE

where index(Name1,'~') = 0 and FileSize1 <> 0 and FileTest1 <> 'Exclude'

ORDER BY FileTime1 DESC;

//use variables to store the most recent files file names

  LET vUSBFile = FieldValue('File_Name', 1);

USERS_BY_USB_LIST:

LOAD [Number of Destination],

     [User Name],

     [Computer Name],

     USB

FROM

(txt, codepage is 1252, embedded labels, delimiter is ',');

STORE USERS_BY_USB_LIST into $(vQVDlocation)USB_LIST.qvd (qvd);

DROP TABLE USERS_BY_USB_LIST;

5 Replies
pipuindia99
Creator III
Creator III

do you get any error when you run this script?

swuehl
MVP
MVP

You are using table name USERS_BY_USB_LIST multiple time. Do you expect Qlik to concatenate the two tables?

Then maybe use the CONCATENATE LOAD prefix to force concatenation.

And use a different table name in your SUB.

sunny_talwar

How do you define proper here? I mean what is not proper in the way QVD is getting stored?

Not applicable
Author

No Errors

Not applicable
Author

Its only pulling

Name1

  FileTime1

  FileCount1  

  FileSize1

  FileTest1