Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
how to evaluate vQlikTableName?
Please advise
not as such but it worked as follows:
store $(vQlikTableName) into 'lib://QVDS/'$(vQlikTableName)'.qvd';
store $(vQlikTableName) into lib://QVDS/'$(vQlikTableName)'.qvd; |
Try with single quotes
not as such but it worked as follows:
store $(vQlikTableName) into 'lib://QVDS/'$(vQlikTableName)'.qvd';