This article will cover the syntax of the ‘Store’ regular script statement

This statement is used to store a QVD, CSV or TEXT file in a specified location.

Statement syntax

Store [fieldlist from] tablename into filename [format-spec];

FieldlistList of fields from a specific table to be stored. This is optional if you need to store all fields in a given table. The ‘fieldlist from’ can be skipped in this case.
FromA keyword only required if you are specifying fields to store.
TablenameThe name of the table that you are storing/ loading the fields to store from.
FilenameName of the file.
Format-specThis can be TXT or QVD. For a CSV file, use TXT. This is optional as if omitted, QVD will be assumed.

Example

A table is created from a combination of Excel files and stored as a QVD.

Sub sales (num)
    SALES:
	LOAD
    	*
    FROM [lib://Public:DataFiles/sales_truck$(num).xlsx]
	(ooxml, embedded labels, table is Sheet1);
End sub;
For a = 1 to 4
	Call sales(a);
Next;
Store SALES into [lib://Public:DataFiles/SALES.qvd] (qvd);

Result

A QVD file ‘SALES’ is stored containing concatenated data from the x4 separate spreadsheets in the loop statement.