# Drop table

One or several Qlik Sense internal tables can be dropped from the data model, and thus from memory, at any time during script execution, by means of a drop table statement. Optionally, use the drop mapping table variant to drop mapping tables—those created with the Mapping prefix—before the end of script execution.

Syntax:

drop [mapping] table tablename {, tablename2 ...}

drop [mapping] tables tablename {, tablename2 ...}

Information noteThe forms drop table and drop tables are both accepted.

The following items will be lost as a result of this:

* The actual table(s).
* All fields which are not part of remaining tables.
* Field values in remaining fields, which came exclusively from the dropped table(s).

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptRegularStatements/drop-table.htm)

#### Examples and results:

| Example | Result |
| --- | --- |
| ```<br>drop table Orders, Salesmen, T456a;<br>``` | This line results in three tables being dropped from memory. |
| ```<br>Tab1:<br>Load * Inline [<br>Customer, Items, UnitPrice<br>Bob, 5, 1.50<br>];<br> <br>Tab2:<br>LOAD Customer, Sum( Items * UnitPrice ) as Sales<br>resident Tab1<br>group by Customer;<br> <br>drop table Tab1;<br>``` | Once the table Tab2 is created, the table Tab1 is dropped. |
| ```<br>// Load mapping table of country codes:<br>map1:<br>mapping LOAD *<br>Inline [<br>CCode, Country<br>Sw, Sweden<br>Dk, Denmark<br>No, Norway<br>] ;<br>// Load list of salesmen, mapping country code to country<br>// If the country code is not in the mapping table, put Rest of the world<br>Salespersons:<br>LOAD *,<br>ApplyMap('map1', CCode,'Rest of the world') As Country<br>Inline [<br>CCode, Salesperson<br>Sw, John<br>Sw, Mary<br>Sw, Per<br>Dk, Preben<br>Dk, Olle<br>No, Ole<br>Sf, Risttu] ;<br>// We don't need the CCode anymore<br>Drop Field 'CCode';<br>									<br>Drop Mapping Table map1;<br><br>Metrics:<br><br>Load * Inline [<br>Transaction ID, Sales Amount, Sales Cost, City, Customer ID<br>1000012, 4509.33, 1234.22, Oslo, 250v9849<br>1000013, 1043.21, 180.23, Gothenburg, 195d5930<br>1000014, 6038.35, 1400.10, Copenhagen, 195d5930<br><br>];<br>``` | This example shows how the Drop mapping table variant can be used. A mapping table map1 is created and then used in a subsequent LOAD statement with the ApplyMap function. After the mapping table has been used, it is dropped from memory, optimizing RAM usage for the data to be loaded in subsequent tables of the script execution.<br><br>In this case, with only a few rows in the mapping table, the RAM optimization would be minimal. However, for large mapping tables or when creating mapping tables within loops, performance can be significantly improved. |

## Learn more

* [Rename table](https://help.qlik.com/en-US/sense/May2026/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptRegularStatements/rename-table.htm)
* [Drop field](https://help.qlik.com/en-US/sense/May2026/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptRegularStatements/drop-field.htm)
* [Drop](https://help.qlik.com/en-US/sense/May2026/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptRegularStatements/Drop.htm)
* [Table/Tables](https://help.qlik.com/en-US/sense/May2026/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptRegularStatements/Table.htm)
* [Mapping](https://help.qlik.com/en-US/sense/May2026/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptPrefixes/Mapping.htm)