Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variables

Hi everybody

i'm facing a strange issue or misunderstanding

When I

LOAD * FROM   [$(PathQVD)\$(FileNameQVD).qvd] (qvd);

everyting's OK

BUT When i'm doing

LET v =filename([$(PathQVD)\$(FileNameQVD).qvd]);

my variable v is NULL

Any idea ?

Thnak you

Chris

1 Solution

Accepted Solutions
Not applicable
Author

OK

i found why

FileName is the problem. Returns always NULL

FielSize returns a value if file exists and null if doesn't

Thnak you everybody for your help

Chris

View solution in original post

13 Replies
Not applicable
Author

What exactly u want to store in variable v??

maxgro
MVP
MVP

this is an example of using filename from online help

Load *, filename( ) as X from

C:\UserFiles\abc.txt

Will return 'abc.txt' in field X in each record read.

MK_QSL
MVP
MVP

Try this

LET v =filename('[$(PathQVD)\$(FileNameQVD).qvd]');

rustyfishbones
Master II
Master II

You don't need a variable

try

LOAD *,

FileName() as Filename

FROM [$(PathQVD)\$(FileNameQVD).qvd] (qvd);

Not applicable
Author

I want to check wether or not the file exists

so if i get a filename it does

Chris

Not applicable
Author

I did already,  it doesn't

Chris

Not applicable
Author

Yes I do,

i don't want to load data, just check if the file exists

Chris

rustyfishbones
Master II
Master II

Hi Chris,

You may want to use this instead

LOAD *,

FilePath() as Path

FROM [$(PathQVD)\$(FileNameQVD).qvd] (qvd);


This will give you the full path of where the file is located and the filename


Regards


Alan

maxgro
MVP
MVP

for qvd file there are qvd file functions

answer here (and example)

Re: How can I check if a file exists ?

QvdCreateTime

Returns the XML-header time stamp from a QVD file if any (otherwise NULL).

The filename is the name of a QVD file, if necessary including path.

Examples:

QvdCreateTime('MyFile.qvd')

QvdCreateTime('C:\MyDir\MyFile.qvd')