Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

help in script syntax

Hello

I'm working on Qlik Sense project

I'm reading the names of the tables and looping through them to read and store data as qvd

my script is as follows and it works correctly in QlikView:

temp_tables:

    load *;

    sql select

   table_name as name

        from information_schema.tables

        where table_schema = 'lmms'

and lower(table_name) in
(
               'community'

                    ,'person'

                    ,'member'

                    ,'marital_status'

                    ,'household'

                    ,'household_condition'

                    ,'gov_id'

                    ,'gov_id_type'

                    ,'member_vulnerability'

,'member_vulnerability_assoc'

                    ,'distribution'

                    ,'location'

                    ,'project'

                    ,'fdp'

                    ,'item'

                    ,'project_type'

                    ,'member_status'

                );

/*************************************************************************************/

    /*

   now read data and store each table as QVD file

    */

for i=0 to NoOfRows('temp_tables')-1
let vTableName = Peek('name',$(i),'temp_tables');
if left('$(vTableName)',1) = '@' then
let vTableName = '"' & '$(vTableName)' & '"';
endif
let vQlikTableName = replace(Replace('$(vTableName)','"',''),'@','');
$(vQlikTableName):
load *;
sql select * from $(vTableName);
store $(vQlikTableName) into lib://QVDS/$(vQlikTableName).qvd;
drop table $(vQlikTableName);
next

tables are stored as such

Untitled.png

how to evaluate vQlikTableName?

Please advise

I can walk on water when it freezes
1 Solution

Accepted Solutions
ali_hijazi
Partner - Master II
Partner - Master II
Author

not as such but it worked as follows:

store $(vQlikTableName) into 'lib://QVDS/'$(vQlikTableName)'.qvd';

I can walk on water when it freezes

View solution in original post

2 Replies
vinieme12
Champion III
Champion III

store $(vQlikTableName) into lib://QVDS/'$(vQlikTableName)'.qvd;

Try with single quotes

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
ali_hijazi
Partner - Master II
Partner - Master II
Author

not as such but it worked as follows:

store $(vQlikTableName) into 'lib://QVDS/'$(vQlikTableName)'.qvd';

I can walk on water when it freezes