Sorting dates

[Cloud release: 2025.09.17]
[On-prem release: 2025 October]
[On-prem build: 25.10.10001]


If you have a pure date dimension, i.e., a dimension containing only dates, you can sort these dates in ascending date order or descending date order once you have created a Date Mask for this dimension.

Use case:

  • By applying a descending sort order on dates in a table, the table will always show the latest data towards the top of the table.

Note: The date sorting function can only work with single-level dimensions containing dates, i.e. it cannot work with hierarchies such as a YMD hierarchy or a YQMD hierarchy etc.

Prerequisite: The Date Mask

Dates - as any other dimension members - are displayed as strings in the TARGIT client. Without the Date Mask, the dates will be sorted alphabetically as any other strings, which in many cases will provide the wrong sorting order for dates.

For sorting functions to interpret dates correctly, we need to supply a Date Mask to the date dimension.

This can be done in two ways:

  • Globally, in TARGIT Management Decorations. Setting the date mask on a date dimension in Decorations has the advantage that you only need to set it once to make it work for all Designer users in all objects using this dimension.
  • Locally, in the individual documents. With this option, you will need to define the Date Mask every time you work on a new document using date sorting. E.g., if you are working on a cube that you just created from an Excel sheet with Data Discovery, and you want to test some date sorting, then you can immediately set up the Date Mask in the client rather than waiting for it to be available via Decorations.

Generally, when setting up the date mask, it should match the format of the date dimension as you see it in the TARGIT client.

In TARGIT Management Decorations, look up the date dimension and set the 'Date member value mask' property accordingly:

 

Alternatively, in the TARGIT Designer client, right click the date dimension and select 'Member value' to set the Date Mask:

 

 

Once the Date Mask has been defined, you can then do date sorting like this (click the sorting arrow in the Date column header):

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.