# Drop table

drop table ステートメントを使用すると、スクリプトの実行中にいつでもデータ モデルやメモリから 1 つ以上の Qlik Sense 内部テーブルを削除できます。 必要に応じて、スクリプト実行終了前に、drop mapping table バリアントを使用してマッピング テーブル (Mapping プレフィックスで作成されたもの) を削除できます。

構文:

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

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

情報メモ形式は drop table と drop tables のどちらでも構いません。

以下のアイテムが削除されます。

* 実際のテーブル
* 残されたテーブルに属さないすべての項目。
* 残された項目に含まれる項目値 (削除されたテーブルから排他的に発生)。

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

#### 例と結果:

| 例 | 結果 |
| --- | --- |
| ```<br>drop table Orders, Salesmen, T456a;<br>``` | メモリから 3 つのテーブルが削除されます。 |
| ```<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>``` | テーブル Tab2 が作成されると、テーブル Tab1 は削除されます。 |
| ```<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>``` | この例は、Drop mapping table バリアントの使用方法を示しています。マッピング テーブル map1 が作成され、その後 LOAD ステートメントで ApplyMap 関数とともに使用されます。マッピング テーブルが使用された後、メモリからドロップされ、スクリプト実行の後続のテーブルにロードされるデータの RAM 使用量が最適化されます。<br><br>この場合、マッピング テーブルの行数が少ないため、RAM の最適化はわずかになります。ただし、大規模なマッピング テーブルの場合や、ループ内でマッピング テーブルを作成する場合は、パフォーマンスを大幅に向上させることができます。 |

## 詳細を見る

* [Rename table](https://help.qlik.com/ja-JP/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptRegularStatements/rename-table.htm)
* [Drop field](https://help.qlik.com/ja-JP/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptRegularStatements/drop-field.htm)
* [Drop](https://help.qlik.com/ja-JP/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptRegularStatements/Drop.htm)
* [Table/Tables](https://help.qlik.com/ja-JP/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptRegularStatements/Table.htm)
* [マッピング](https://help.qlik.com/ja-JP/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptPrefixes/Mapping.htm)