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

Determine FileName Prefix

Hi Guys,

I try to determine the prefix set on the file name.

On the first hand, i have a list of prefix available and already loaded (table FilesPrefixs)

On the other hand, i have a folder containing a list of files as Input.

The goal is to determine what is the correct prefix to execute the correct SUB.

What i have done at this time :

DeterminePrefixTemp:

LOAD FileNamePrefix

RESIDENT FilesPrefixs

WHERE SubStringCount(SubField($(vFileName),'-',1), FileNamePrefix) > 0;

For example :

> vFileName contain ABCD1243-20120101-195312

> FileNamePrefix is supposed to contain : ABCD

The result is an error : Unknown Field : ABCD

I don't understand where is my problem.

Do you have an idea on what i'm doing wrong.

Thanks a lot for your help.

1 Solution

Accepted Solutions

Re: Determine FileName Prefix

HI

SubStringCount(SubField('$(vFileName)','-',1), FileNamePrefix)

I think error you occur, field not found <ABCD>..

if not, please check the data in fieldnameprefix

That helps

4 Replies
MVP & Luminary
MVP & Luminary

Re: Determine FileName Prefix

Your table FilesPrefixs does not have a field named ABCD. So LOAD ABCD ....etc fails.


talk is cheap, supply exceeds demand

Re: Determine FileName Prefix

HI

SubStringCount(SubField('$(vFileName)','-',1), FileNamePrefix)

I think error you occur, field not found <ABCD>..

if not, please check the data in fieldnameprefix

That helps

Not applicable

Re: Determine FileName Prefix

The field i'm loading from FilesPrefixs is : FileNamePrefix not ABCD

and i want to identify the row preseting the value ABCD.

Not applicable

Re: Determine FileName Prefix

Hi Mayil,

you're right, this was the problem.

Thanks a lot.