Clear an entire cube


It is possible to clear all data in a cube with 3 Turbo Integrator statements. Paste this code in the Advanced > Prolog tab and change the cube name:


Note that this is fast, yet possibly very dangerous. You could loose all data in the cube if you do not have decent backup mechanisms.

A new function

As from TM1 9.5, the function CubeClearData does the same:


Note that in some TM1 versions, execution this function might crash the TM1 application, when rules are attached to the cube that is cleared.

No unnecessary logs

It might be wise to turn off temporarily the logging of changes to this cube in the clear process:

# your zero out code

A rule-based approach

Another alternative is to write a very simple rule. If you want to clear all data for 2012, you could use (provided elements are called like this):


Put this rules statement on top of the rules editor for the cube you want to zero out. Save the rules. Then, remove the line and again save the rules for that cube. Note: be sure to know what you are doing !


Section contents

About Wim

Wim Gielis is a Business Intelligence consultant and Excel expert

Other links