Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Help assign a variable in script and retrieve in from statement

I have never used a variable in the script so examples in the answer would be appreciative.

I have the below

SET vpathName='C:\Users\xxx\Desktop\QlikView\QlikView Folder Structure Zip File\QlikView Structure\3_Resources\';

temp:

load

StateName,

county,

city

FROM $(vpathName)tests test.xlsx

(
embedded labels, table is testing) ;

script states, Field not found - <StateName>

Thoughts on whyI recieve this error and how do I fix?

1 Solution

Accepted Solutions
Not applicable
Author

Use this:

vpathName='C:\Users\xxx\Desktop\QlikView\QlikView Folder Structure Zip File\QlikView Structure\3_Resources\';

temp:

load

StateName,

county,

city

 

FROM $(vpathName)tests test.xlsx
(
embedded labels, table is testing) ;


where I assume the file is called  "tests test.xlsx" and Sheet is called testing





This is an example that work for me:


vpathName='C:\QlikPrj\FabStdBI\';

temp:

load

[Codice ISTAT],

[Presenze turistiche per abitante]

FROM $(vpathName)Rating_Efficienza.xlsx

(ooxml, embedded labels, table is BASEDATI);

Regards

Gennaro

View solution in original post

8 Replies
sunny_talwar

Try using LET instead of SET

avinashelite

Hi,

Please check the path once......and field in the files .

Either the path is wrong or the filed is not available

Not applicable
Author

Use this:

vpathName='C:\Users\xxx\Desktop\QlikView\QlikView Folder Structure Zip File\QlikView Structure\3_Resources\';

temp:

load

StateName,

county,

city

 

FROM $(vpathName)tests test.xlsx
(
embedded labels, table is testing) ;


where I assume the file is called  "tests test.xlsx" and Sheet is called testing





This is an example that work for me:


vpathName='C:\QlikPrj\FabStdBI\';

temp:

load

[Codice ISTAT],

[Presenze turistiche per abitante]

FROM $(vpathName)Rating_Efficienza.xlsx

(ooxml, embedded labels, table is BASEDATI);

Regards

Gennaro

Anonymous
Not applicable
Author

I have tried LET, same result. It's finding the path name (I believe) but the field names are not found...

sunny_talwar

This is what I would do if I were you:

Rebring the script for the table by using the 'Table Files..' button. and then once it appears in your script, I would cut the path from there and save it as your variable vpathName. This way you will avoid any mistakes with the link, path, field name etc...

Try and I hope this will solve your issue.

Best,

Sunny

Anonymous
Not applicable
Author

To clear up the issue...I had

$(vPathName)EmpOff.xls

(
embedded labels, table is Office$);

I needed:

$(vPathName)EmpOff.xls

(ooxml,
embedded labels, table is Office$);

Added the ooxml


Not applicable
Author

Try this:

vpathName='<your path with final \ >';

temp:

load

[Codice ISTAT],

[Presenze turistiche per abitante]

FROM $(vpathName)<your file name and extension>

(ooxml, embedded labels, table is <sheet name>);

No LET no Set, verify the file name and sheet name

In previus post I have included a real code that works for me


Regards

Gennaro

sunny_talwar

Hahahaha, I am glad you found what you were missing . The best way to handle these kind of things is to bring the table again using 'Table Files...' button and then copy paste the link from there to your variable. Any chances of missing things get negligible

Best,

Sunny