Qlik Community

QlikView Documents

Documents for QlikView related information.

Store and drop the table in QVD using a subroutine

Store and drop the table in QVD using a subroutine

Hi Folks,

Hope this document wil help of beginner in order to avoid multiple store and drop statement while storing the information in QVD.

//Qvd Path

Let vQvdPath = 'Qvd\';

//Sub Routine Start

Sub StoreStatement

//Store the table in Qvd

Store $(vTableName$(index)) into $(vQvdPath)$(vTableName$(index)).qvd(qvd);

//Drop the table

DROP Table $(vTableName$(index));

//Sub Routine End

ENDSUB

/********************************* Table Information ****************************************************/

InlineTable1:

LOAD * Inline

[

A, B

1, 2

];

InlineTable2:

LOAD * Inline

[

C, D

1, 2

];

/*********************************************************************************************************/

//Store the table name in variables

Let vTableCount =  NoOfTables()-1;

For index = 0 to $(vTableCount)

Let vTableName$(index) = TableName($(index));

NEXT;

//Call the sub routine

For index = 0 to $(vTableCount)

CALL StoreStatement

NEXT;

Comments
rahulpawarb
Valued Contributor II

Excellence post! This will definitely guide Qlikers on how to make use of code usability feature.

Good Job!

P.S.: Cosmetic change - Comment  the Call the sub routine line.


Regards!

Rahul Pawar

Thanks Rahul for your suggestion.

Missed out

santiago_respane
Valued Contributor

Thanks for this useful contribution!

Regards,

Version history
Revision #:
1 of 1
Last update:
‎08-04-2017 12:52 AM
Updated by: