Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save an extra $150 Dec 1–7 with code CYBERWEEK - stackable with early bird savings: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Selecting a file via clicking like in the file-explorer

Each day I have several files with time stamps in the name (data-YYYYMMDD-hhmmss.csv) and sometimes without time stamp so I cannot use loops or something to select the files via name, because the names change day by day, and sometimes I have files created manually with other names.

It is possible to create a file explorer within QV to select the files? Maybe like the file explorer in Windows where I can select and double click.

Thanks in advanced

Thomas

1 Solution

Accepted Solutions
Not applicable
Author

Hello,
If the files have the same structure of data, looping is not accurate.
You must use the special character "* ".



Categoria:
LOAD CategoriaID,
[Nome Categoria],
Descricao
FROM *.csv
(txt, utf8, embedded labels, delimiter is ';', msq);


View solution in original post

3 Replies
Not applicable
Author

Hello,
If the files have the same structure of data, looping is not accurate.
You must use the special character "* ".



Categoria:
LOAD CategoriaID,
[Nome Categoria],
Descricao
FROM *.csv
(txt, utf8, embedded labels, delimiter is ';', msq);


Not applicable
Author

Thanks.

Thats also a solution, I can use that.

But there is no file-explorer to click and select?

prieper
Master II
Master II

You may call the File-Dialogue via API in a macro, e.g.:

' ================================== Read FileName of Rate-File
SUB GetFileName_Rates
ON ERROR RESUME NEXT
SET oFSO = CreateObject("UserAccounts.CommonDialog")
oFSO.Filter = "Excel-Files (*.xls)|*.xls"
InitFSO = oFSO.ShowOpen
IF InitFSO = FALSE THEN
MSGBOX "Please select a file!", vbInformation, "Select Excel-File"
ELSE
ActiveDocument.GetVariable("sRates").SetContent oFSO.FileName, TRUE
MSGBOX "File selected: "&oFSO.FileName, vbInformation, "Rates"
END IF
END SUB
' ===================================================================


In the above there is only one Filename selected (and handed over into a variable), but the file-dialogue also supports multiple Files - you may have to dig a bit into VB probably.

HTH
Peter