Solution For Additionnal Exercises MDX
Solution For Additionnal Exercises MDX
MDX query to retrieve total sales for each product category in the year 2022
SELECT
[Time].[Year].[2022] ON COLUMNS,
[Product].[Category].Members ON ROWS,
[Measures].[Sales] ON PAGES
FROM
[SalesCube]
This MDX query is designed to analyze sales performance in the OLAP cube "SalesCube." It focuses on
the year 2022 and breaks down the total sales amount for each product category. The columns
represent the year 2022, the rows represent different product categories, and the Sales measure
provides the total sales amount. The query allows for a multidimensional analysis of sales data within
the specified dimensions and criteria.
Example 3:
MDX query to retrieve monthly quantity for each product subcategory in the year 2023
SELECT
[Time].[Year].[2023] ON COLUMNS,
[Product].[Subcategory].Members ON ROWS,
[Measures].[Quantity] ON PAGES
FROM
[InventoryCube]
This MDX query aims to analyze monthly product quantity in the OLAP cube "InventoryCube" for the
year 2023. It breaks down the quantity data for each product subcategory, with columns
representing the year 2023, rows representing different product subcategories, and the Quantity
measure providing the monthly quantity. The query enables a multidimensional analysis of inventory
data within the specified dimensions and criteria.