Follow

How to set up partitioning

To set up incremental load on cubes you need the fact table to run with partitioning. There is two types a set date type and a custom, i will describe both below.

Set up partitioning by Date

Create the partition

You start by right clicking on the main menu finding advanced and clicking on Add Partition Table.

Partition1.PNG

If you choose the Date - System Field bullet point the menu you will get three options Year, Month and Day. The Use NULL value Conversion means that if the date field is containing NULL values it should use what is added there.

Partition2.PNG

This is what the table is going to be partitioned into. You should take into account the amount of time it will take to create these when you execute the cube. The bigger the date range the more parts will need to be created.

In this test though Month is fine.

Use the partition

To use it find a fact table that the incremental cube uses and go to the table settings (F4) on the performance pane.

Partition3.PNG

First find and choose the partition table in the template drop-down menu.

Partition4.PNG

Then you choose the the date field you want it to base the partitions on. It could be any date field. If you choose DW_TimeStamp it will create the partitions on new data, though this only works on incremental load tables.

Partition5.PNG

Lastly you choose the Date table you have created. It is used to compare the date data.

Partition6.PNG

Then all you need is to deploy / execute the changes and you are set. Remember to check for incremental load on the cube.

Partition7.PNG

Create a custom partition

Sometimes you do not only want the partition to be based on year, month or day. Perhaps you want dynamic ranges that doesn't adhere to only one timeframe. Below i will show how you can set up just that.

Create the partition

If you already have a partition, you will be able to add new ones by right clicking on the menu and clicking on Add Partition Template.

Partition8.PNG

Change the bullet point to Other - Manual setup. You will now get some different menu points.

Partition9.PNG

You can choose what sort of data type the range should contain. In this case I will choose String.

Partition10.PNG

In the New Range Value text box write A and press the + button. Keep doing this until you have added E. It will then be added to the Range Value area.

11.PNG

In the Advanced area change the Filegroups menu to Per partition.

Partition12.PNG

Set up the ranges

The next step is to create the dynamic ranges.

Start by going to the source table of the table you want to use the partition in. Create a custom text field called Part.

13.PNG

Add some fixed characters.

14.PNG

The next step is to add conditions to the characters. So A becomes equal to today, B becomes equal to current week except today, C becomes equal to current month except current week, D becomes equal to current year except current month and lastly E becomes equal to any data older than current year.

Like this.

15.PNG

I found the condition Here and then re purposed it to work for this. Due to the time of year i made this condition C and D wouldn't get filled. As you can see the rest gets filled out.

16.PNG

Then you pull in the Part field to the Fact table you want to use for partitioning.

Use the partitioning

In the fact table you want to partition go to the table settings and set the template to point at the manual template we made.

17.PNG

Then add the Part field we created in the Field menu.

18.PNG

 

Then all needed is to check for incremental load in the cube that uses the fact table and deploy / execute.

 

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

3 Comments

  • 1
    Avatar
    Thomas Lind

    I do not think so. This is mainly used as a way to lower the execute times on the cubes.

    Partitions are created during execution, when you get new data added, it will create a new partition for that. The date type will work fine with incremental load, depending on which date field you are using.

    Whereas the manual one will keep the previous days settings if it runs in incrmental load. So it will be all A's.

    I will try to work out a way to do it anyway.

  • 0
    Avatar
    Sten Lomme

    Looking forward to it :)

  • 0
    Avatar
    Sten Lomme

    Is it possible to use Date Partitioning and store on different filegroups?

    How would your manual Partition Ranges be affected when used on tables with History and/or Incremental Loads.

Please sign in to leave a comment.