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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how do I get qlikview to match certain file names

I am doing this: For each vFile in FileList('..\LooseDataFiles\*Capabilities.xlsx') however I dont want it to match the Capabilities.xlsx file only the filenames with stuff before it like 2010Capabilities.xlsx?

14 Replies
rustyfishbones
Master II
Master II

Will it always be numbers before it?

Not applicable
Author

no it could be a word or letters or a mixture of both

rustyfishbones
Master II
Master II

Can you share some examples of the names of these files?

Not applicable
Author

2013 capabilities

abscapabilities

a b s capabiltiies

12s capabiltiies

q22capabilities

Not applicable
Author

My 2c.

So you want to have data from tables similar to above but not from capabilities.In that case I would do this.

Load Pky,*

From capabilities;

Load *

Where not exists(Pky,PrimaryKey);

Load Pky as PrimaryKey,*

From *capabilities;

This would exclude the data from capabilities table.

Hope it helps.

Thanks

AJ

Not applicable
Author

i just want to grab all the files that have something letters or numbers preceeding the name capabilities.. thats it..I dont want to grab capabilities.xls

rustyfishbones
Master II
Master II

Hi Christopher,

I tried a few things but no luck here.

Are there many Excel Files, have you tried renaming them?

Regards

Alan

Not applicable
Author

My code will exactly do that if you have a primary key. If not you can create one using AutonumberHash() function.

I Made some changes.

QUALIFY *;

Table:

LOAD A,

   *

FROM capabilities;

UNQUALIFY *;

Main:

LOAD A as Pky,

    *

FROM *capabilities;

Store Main into Main.qvd;

Drop table Main;

Main:

Load *

From Main.qvd(qvd)

Where not Exists ([Table.A],Pky);

This will give you data sans capabilities. Try this and let me know.

rustyfishbones
Master II
Master II

Hi Chris,

I think I have an answer that may work.

Add FileName() as Filename to the Script

and at the end of the LOAD statement add a WHERE Statement

WHERE LEN(FileName()) >= 18

It means it will only load files that have more than capabilities.xlsx in them