Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

qlikview script: Drop all tables where table name like '%%' ?

Hi,

I have a script which is generating the dimension tables dynamically so we are not sure what are the tables names going to be. We just know that the table names are going to be started with C_

I wonder if at the end of script, there is someway to dynamically get the names of all the tables that start with C_ and then drop them all

Shah

4 Replies
anbu1984
Master III
Master III

FOR i = 0 to NoOfTables()

LET vTabNam = TableName($(i));

TRACE '$(vTabNam)';

If '$(vTabNam)' Like 'C_*' Then

Drop Tables '$(vTabNam)'  ;

ENDIF;

NEXT i

Not applicable
Author

Hi Anbu,

It works..thanks. One more question though, If I wanted to add another condition to make it like

If '$(vTabNam)' Like 'C_*' and '$(vTabNam)' not Like 'C_D_*' then

How can I do that in Qlikview? I guess there is no NOT LIKE operator in Qlikview so what would be the alternative?

Shah

anbu1984
Master III
Master III

Not('$(vTabNam)' Like 'C_D_*')


Or


Left('$(vTabNam)',1,4) <> 'C_D_'

perumal_41
Partner - Specialist II
Partner - Specialist II

Hi

Try like below

 

If

not

('$(vTabNam)' like

'C_D*' ) and

'$(vTabNam)' like

'C_*' Then



Drop

Tables

'$(vTabNam)' ;

ENDIF

;

NEXT

i