Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
QlikToFindOut
Creator
Creator

How to drop all tables with exclusions.

I am currently performing a binary load on the governance dashboard and there are some unwanted tables that impact performance. The problem is that some tables in PROD governance don't exist in DEV or QA governance.

Is there a way to drop all tables except for a chosen few tables? I have tried the following:

Drop All Tables Except

but it doesn't drop all tables. It drops about half of the tables. The same goes for the following code:

SET vexemptList= 'SessionTaskAuditMaster Governance_AD_Link AD_USERS Profit_Centers PC_LOB';

LET vNoofTables = NoOfTables();

For vTableNo = 0 to vNoofTables-1 ;

  //When one table get deleted the next in line get that number.So always delete first table in the list.

  //For example if there is 4 tables and loop already finished 2 times there will not be any value for TableName(3)

  vTableName = TableName(0) ;

  Let vIndex = Index('$(vexemptList)','$(vTableName)') ;

  If $(vIndex)=0  then

  DROP Table $(vTableName);

  ENDIF

NEXT

It only drops some and not all of the tables.

Is there a way to drop all tables with exclusions? Thank you.

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I could speculate, but the best way to debug this kind of problem is to look at the script log to see what's happening. If you can't figure out what the problem is from the log, please post the relevant portion of the log here.

BTW, when I do this kind of processing I usually walk the tables backwards, avoiding the changing index problem.

For vTableNo = vNoofTables-1 to 0 step -1  ;

vTableName = TableName(vTableNo) ;


-Rob

http://masterssummit.com

http://qlikviewcookbook.com

View solution in original post

2 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I could speculate, but the best way to debug this kind of problem is to look at the script log to see what's happening. If you can't figure out what the problem is from the log, please post the relevant portion of the log here.

BTW, when I do this kind of processing I usually walk the tables backwards, avoiding the changing index problem.

For vTableNo = vNoofTables-1 to 0 step -1  ;

vTableName = TableName(vTableNo) ;


-Rob

http://masterssummit.com

http://qlikviewcookbook.com

QlikToFindOut
Creator
Creator
Author

Working the table backwards solved my problem, thank you!