Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Levente
Contributor II

For each table in a certain app - looping through all available tables in the app

Hi,

Could you please help me how could I get metadata about my tables?

metadata:

load * inline[

recnometa, tablename

];

For each ?table? in ?certain_app?

        Concatenate (metadata)

        Load Recno() as recnometa

        ?name of the table? as tablename

        Resident ?actual_table_in_loop?

         ;

Next ?table?

 

Thanks and best regards,

Levente

Labels (1)
2 Replies
Lisa_P
Employee

There are a number of table functions that can be used in the script to help.

FOR tableIdx = NoOfTables()-1 to 0 step -1
LET vTable = TableName($(tableIdx));
TableList:
LOAD
RecNo() as Number,
'[$(vTable)]' as TableName
AutoGenerate 1;
NEXT tableIdx;

STORE TableList INTO
lib://QVDFiles/TableList.csv (txt);

 

Levente
Contributor II
Author

Hi Lisa,

Thanks for the script you sent, but for me the most important part was to be able to refer to tables using variable. I needed to know how to call a table after "resident" command.

I would like to build a metadata query  to retrieve count of records in certain table(s). Furthermore, I would like to get Nb of distinct values, Nb of values in all related fields (one by one).

I have now a script which seems to work fine. I kept searching for scripts shared in Qlik Data Analytics Forums and found one that helped me to build what I need.

Best regards,

Levente