Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
AmCh
Creator
Creator

Import Excel

Hi all,

First step:

I want to load xls. file and assign every cell value to a variable:

 ABC
1123
2456
3789


The variables should be defined as A1 ... C3.

Second step:

A1...C3 should be stored in a new Field called e.g. Input

I need Input in another qvw.

Third step:

After loading Input in the new qvw. I need the variables A1...C3 again.

 

Any help please?

Thanks in advance.

1 Solution

Accepted Solutions
Vegar
MVP
MVP

Take a look at this script.

 

***/
Inputs:
CrossTable(InputName,InputValue)
LOAD * inline [
ID,A,B,C
1,1,2,3
2,4,5,6
3,7,8,9
]
;

Store Inputs into Inputs.qvd (qvd); //Use this QVD as source when importing into new app.

//Use input source from row 20... or load the data from Inputs.qvd before looping through the rows generating your variables.
FOR _row = 1 to NoOfRows('Inputs')
LET vVar= peek('InputName', '$(_row)','Inputs')&peek('ID', '$(_row)','Inputs');
LET vVal= peek('InputValue','$(_row)','Inputs');
LET $(vVar) = '$(vVal)';
next

 

Vegar_0-1620650813202.png

 

See attached qvw

View solution in original post

1 Reply
Vegar
MVP
MVP

Take a look at this script.

 

***/
Inputs:
CrossTable(InputName,InputValue)
LOAD * inline [
ID,A,B,C
1,1,2,3
2,4,5,6
3,7,8,9
]
;

Store Inputs into Inputs.qvd (qvd); //Use this QVD as source when importing into new app.

//Use input source from row 20... or load the data from Inputs.qvd before looping through the rows generating your variables.
FOR _row = 1 to NoOfRows('Inputs')
LET vVar= peek('InputName', '$(_row)','Inputs')&peek('ID', '$(_row)','Inputs');
LET vVal= peek('InputValue','$(_row)','Inputs');
LET $(vVar) = '$(vVal)';
next

 

Vegar_0-1620650813202.png

 

See attached qvw