Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
stekol61
Creator
Creator

Load files with datestamp

I am trying to load data form different files.

I use this expression:

Let vFile = 'SS_Core_KPI-1-4G_Attach_SR-' & date(today(), 'YYYY-MM-DD'&'.csv');

LOAD *
FROM
[\\sehan5863asqva3.tcad.telia.se\Qlik QDF DEV\1.Group\3.Applications\11.Bile_Core\8.Import\Felix\$(vFile)]
(txt, codepage is 1252, embedded labels, delimiter is ';', msq);

 

The problem is that the filename contains both date and HH-MM. And HH-MM differs from day to day.

How can this be handled?

SE_Core_KPI-1-4G_Attach_SR-2021-06-29-01-00.csv

 

/Stefan

1 Solution

Accepted Solutions
Fred
Partner - Creator
Partner - Creator

Hi Stefan,

You could use wildcards to pick up the files and completely disregard the time in the file name.
Only works if a file is dropped once a day and if you don't really care about the time.

I used  the '?' wildcard for the time format in your file name.

LET vFile = 'FileName-' & date(today(), 'YYYY-MM-DD') & '-??-??.xlsx';

LOAD
*
FROM [lib://ConnectionName/$(vFile)]
(ooxml, embedded labels, table is Sheet1);

Good luck!

View solution in original post

1 Reply
Fred
Partner - Creator
Partner - Creator

Hi Stefan,

You could use wildcards to pick up the files and completely disregard the time in the file name.
Only works if a file is dropped once a day and if you don't really care about the time.

I used  the '?' wildcard for the time format in your file name.

LET vFile = 'FileName-' & date(today(), 'YYYY-MM-DD') & '-??-??.xlsx';

LOAD
*
FROM [lib://ConnectionName/$(vFile)]
(ooxml, embedded labels, table is Sheet1);

Good luck!