Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
SatyaPaleti
Creator III
Creator III

how to get fields information through loop for limited tables

Hi Everyone,

I have below requirement. we are having N no of tables. listed as below

Table_Dept_Employees,

Table_Dept_Salary,

Table_Dept_Products,

Table_All_Employees,

Table_All_Salary,

Table_All_Products,

I want to list out tables where string "DEPT" is available. 

in Every Dept Table. There are 2 fields Dept Code & Dept Full Name. we want to show these two field information from every Dept table.

Can some one please help to resolve this issue

 

Thanks,

Satya

 

Labels (1)
2 Replies
edwin
Master II
Master II

did you need to do this in the script or in a chart?  

also its not good practise to have the same multiple fields in more than 1 table - creates synthetic keys.  maybe youd want to paste your data model.

edwin
Master II
Master II

if you need this in your script, the following shows you how to loop through each table name and in the loop you can do what you want with each table:

NoConcatenate
tables:
load
null() as table
AutoGenerate(0);

for i=0 to NoOfTables()-1
Concatenate(tables)
load TableName($(i)) as table, wildmatch(TableName($(i)),'*DEPT*') as match
AutoGenerate(1);
next