Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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

Tags (1)
1 Solution

Accepted Solutions
Not applicable

Re: Variables

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

13 Replies
Not applicable

Re: Variables

What exactly u want to store in variable v??

MVP
MVP

Re: Variables

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.

MVP
MVP

Re: Variables

Try this

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

rustyfishbones
Honored Contributor II

Re: Variables

You don't need a variable

try

LOAD *,

FileName() as Filename

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

Not applicable

Re: Variables

I want to check wether or not the file exists

so if i get a filename it does

Chris

Not applicable

Re: Variables

I did already,  it doesn't

Chris

Not applicable

Re: Variables

Yes I do,

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

Chris

rustyfishbones
Honored Contributor II

Re: Variables

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

MVP
MVP

Re: Variables

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')