Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
If you are a Qlik Insight Bot user, join this collaborative group: JOIN GROUP
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
Highlighted
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

View solution in original post

13 Replies
Highlighted
Not applicable

Re: Variables

What exactly u want to store in variable v??

Highlighted
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.

Highlighted
MVP
MVP

Re: Variables

Try this

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

Highlighted
Honored Contributor II

Re: Variables

You don't need a variable

try

LOAD *,

FileName() as Filename

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

Highlighted
Not applicable

Re: Variables

I want to check wether or not the file exists

so if i get a filename it does

Chris

Highlighted
Not applicable

Re: Variables

I did already,  it doesn't

Chris

Highlighted
Not applicable

Re: Variables

Yes I do,

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

Chris

Highlighted
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

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