---
title: How to Create OLAP Snippets?
description: "**OLAP Snippets** are reusable pieces of MDX code that you can create once and use throughout your [Jet Reports project](https://globaldata365.com/jet-reports/). They’re especially helpful when you want to write complex calculations just once and easily apply them in different areas.  …"
url: "https://globaldata365.com/helpcenter/how-to-create-olap-snippets/"
updated: "2026-10-25"
category: Jet Analytics
---

# How to Create OLAP Snippets?

**OLAP Snippets** are reusable pieces of MDX code that you can create once and use throughout your [Jet Reports project](https://globaldata365.com/jet-reports/). They’re especially helpful when you want to write complex calculations just once and easily apply them in different areas.

 

### What is MDX?

 

MDX stands for **Multidimensional Expressions**, a query language used to pull data from [OLAP cubes](https://globaldata365.com/helpcenter/how-to-create-cube-data-source-in-jet-reports/)—commonly used in reporting and analysis tools like[Jet Reports](https://youtu.be/BYMalzELbkc).

 

### Why Use OLAP Snippets?

- Reuse the same logic across your project
- Make maintenance easier
- Allow other users to work with ready-made logic
- Use dynamic parameters to adapt to different scenarios

### How to Create an OLAP Snippet?

 

Let’s walk through an example:
We'll create a snippet that returns the value for the **previous period** based on what's currently selected.

> For example:
> If a user selects **July 2020**, the snippet will return the value for **June 2020**.
> If they select **Q1 2020**, it will return **Q4 2019**.

This can be helpful when comparing current and previous periods side-by-side.

 **Want to turn raw ERP data into powerful business insights?**
[👉 Join our Jet Analytics Training](https://globaldata365.com/jet-analytics-training/) and master building data warehouses, cubes, and advanced dashboards.

### Step-by-Step Instructions

1. **Open Jet Data Manager**
   Go to the **Tools** tab and click **Snippets**.
   ![Create OLAP Snippets](https://globaldata365.com/wp-content/uploads/2025/06/Create-OLAP-Snippets-300x101.webp)
2. **Add a New Snippet**
   Click **Add** → Select **SSAS Multidimensional Snippet**.
   ![Create OLAP Snippets](https://globaldata365.com/wp-content/uploads/2025/06/Create-OLAP-Snippets-2-300x298.webp)
3. **Fill Out the Snippet Info**

   - Give your snippet a name. (e.g., *Prior Period*)
   - Optionally, write a short description.
   - Enter your MDX code:
         `([Date Hierarchy].CurrentMember.PrevMember, [Measure])`
     ![Create OLAP Snippets](https://globaldata365.com/wp-content/uploads/2025/06/Create-OLAP-Snippets-in-jet-275x300.webp)  
4. **Add Parameters**
   Now we’ll make parts of the formula dynamic, so other users can customize them:

   - Highlight `[Date Hierarchy]` and click **Add Parameter**
     → Set Type to **Hierarchy**
     → Add a description (optional)
   - Highlight `[Measure]` and click **Add Parameter**
     → Set Type to **Measure**
     → Add a description (optional)
     ![add measure and hierarchy](https://globaldata365.com/wp-content/uploads/2025/06/add-measure-and-hierarchy-300x53.webp)
5. **Organize the Snippet (Optional)**
   If you're using folders for snippets, choose where this one should go.
   For this example, you might place it under the **Time** folder.
   ![Create OLAP Snippets](https://globaldata365.com/wp-content/uploads/2025/06/Create-OLAP-Snippets-in-jet-data-manager-275x300.webp)
6. **Save the Snippet**
   Click **OK** to save it in your project.

 

And that’s it! You now have a dynamic, [reusable OLAP Snippet](https://globaldata365.com/helpcenter/how-to-use-olap-snippet-in-jet-data-manager/) that calculates the prior period’s value—ready to be used in your Jet Reports project.

 

#### If You Need Any Help, [Contact us](https://globaldata365.com/contact/) Now!

###### Still have Questions?

Ask us anything about this article – we’ll get backto you shortly. 
