Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

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

"File not found" error when calling a variable in a LOAD statement

Hi,

I'm new to QlikView and have one basic question: Why the code below (script edit) doesn't work?

LET loggedUser=OSUser();

tbPermissions:

LOAD a,

     b,

     c,

     d,

     e,

     f,

     g

FROM

C:\Projects\QlikView\Permissions.xls

(biff, embedded labels, table is Plan1$);

LOAD TextCount(a) as test Resident tbPermissions Where a = $(loggedUser);

I get the following error when the script is reloaded:

Field not found - <MYDOMAIN\myuser>

LOAD TextCount(PRINCIPAIS_NUMEROS) as visualizaPrincipaisNumeros Resident tbPermissoes Where PRINCIPAIS_NUMEROS = MYDOMAIN\myuser

It seems the that the user name is not interpreted as a String. The code below works, but I really need to use the variable "loggedUser":

LOAD TextCount(a) as test Resident tbPermissions Where a = OSUser();

I am using QlikView Personal Edition for Windows, version 10.00.9061.7 SR3.

1 Solution

Accepted Solutions
danielrozental
Honored Contributor II

"File not found" error when calling a variable in a LOAD statement

you are missing single quotes Where PRINCIPAIS_NUMEROS = 'MYDOMAIN\myuser'

2 Replies
danielrozental
Honored Contributor II

"File not found" error when calling a variable in a LOAD statement

you are missing single quotes Where PRINCIPAIS_NUMEROS = 'MYDOMAIN\myuser'

Not applicable

"File not found" error when calling a variable in a LOAD statement

Daniel,

May be I wasn't clear enough, but the text in red is the error message, not the script. Anyway, I tried to sorround "$(loggedUser)" with single quotes and it worked...

LOAD TextCount(a) as test Resident tbPermissions Where a = '$(loggedUser)';

I thought that anything inside single quotes would be interpreted as a string, I didn't realyze it would process "$(loggedUser)" first and evaluate the entire result with single quotes after.

God bless you! Regards,

Marcel