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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
didierodayo
Partner - Creator III
Partner - Creator III

store load result into variable

Hello,

I am trying to store all the previous load result into a variable. Peek() is not working for my scenario because I want al the result in variable. I don't want to use where exists because I will be using the same variable for many loads. How can I achieve this.

Thanks


table1:
LOAD * Inline [
fields
1
2
3
4]
;

let vMyTableName = peek('fields',0,'table1');

table2:
LOAD home
FROM
(
ooxml, embedded labels, table is Sheet1) where home = '$(vMyTableName)';

Labels (1)
1 Solution

Accepted Solutions
settu_periasamy
Master III
Master III

May be try this..

table1:
LOAD Concat(chr(39)&fields&chr(39),',') as fields;
LOAD * Inline [
fields
1
a
3
c]
;

let vMyTableName = peek('fields',0,'table1');
DROP Table table1;

table2:
LOAD * INLINE [
Dim
1
2
3
4
5
a
b
c
]
Where Match(Dim,$(vMyTableName));

View solution in original post

4 Replies
vinieme12
Champion III
Champion III

try without quotes, single quotes is use for comparing strings

table1:
LOAD * Inline [
fields
1
2
3
4]
;

let vMyTableName = peek('fields',0,'table1');


table2:
LOAD home
FROM
(
ooxml, embedded labels, table is Sheet1) where home = $(vMyTableName);

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
didierodayo
Partner - Creator III
Partner - Creator III
Author

I have.  The problem is that I want to store all the values from table1 into the variable.  Not just 1 value.

In my case table 1 could have both numbers and string.

Thanks

settu_periasamy
Master III
Master III

May be try this..

table1:
LOAD Concat(chr(39)&fields&chr(39),',') as fields;
LOAD * Inline [
fields
1
a
3
c]
;

let vMyTableName = peek('fields',0,'table1');
DROP Table table1;

table2:
LOAD * INLINE [
Dim
1
2
3
4
5
a
b
c
]
Where Match(Dim,$(vMyTableName));

didierodayo
Partner - Creator III
Partner - Creator III
Author

Thanks Settu it worked.