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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Is it possible to use variable in Store command

Is it possible to use variable in Store command  ? Like  STORE $(srctab) into $(tgttab);

??

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

Just in case you or someone else needed an example:

[Table 1]:

LOAD * Inline [
f1, f2
a,1
b,2
c,3
]
;

[Table 2]:
LOAD * Inline [
f3,f4
d,4
e,5
f,6
g,7
h,8

i,9
]
;



for i=0 to NoOfTables()-1
     let vtbl = TableName($(i));
     let vrows = NoOfRows('$(vtbl)');

     if $(vrows)>5 then
         
set vstore = 'C:\Users\Test\Desktop\QVW\Over5\';
     else
          set vstore = 'C:\Users\Test\Desktop\QVW\LessThan5\';
     ENDIF

     STORE '$(vtbl)' into $(vstore)$(vtbl).qvd;
next

View solution in original post

3 Replies
swuehl
MVP
MVP

Yes.

Not applicable
Author

Hi,

Just in case you or someone else needed an example:

[Table 1]:

LOAD * Inline [
f1, f2
a,1
b,2
c,3
]
;

[Table 2]:
LOAD * Inline [
f3,f4
d,4
e,5
f,6
g,7
h,8

i,9
]
;



for i=0 to NoOfTables()-1
     let vtbl = TableName($(i));
     let vrows = NoOfRows('$(vtbl)');

     if $(vrows)>5 then
         
set vstore = 'C:\Users\Test\Desktop\QVW\Over5\';
     else
          set vstore = 'C:\Users\Test\Desktop\QVW\LessThan5\';
     ENDIF

     STORE '$(vtbl)' into $(vstore)$(vtbl).qvd;
next

Not applicable
Author

Thanks a lot