Questions tagged [mdx-query]

A sample MDX query looks like below.

[ WITH <SELECT WITH clause> [ , <SELECT WITH clause> ... ] ]   
SELECT [ * | ( <SELECT query axis clause>   
    [ , <SELECT query axis clause> ... ] ) ]  
FROM <SELECT subcube clause>   
[ <SELECT slicer axis clause> ]  
[ <SELECT cell property list clause> ]  
140 questions
1
vote
1 answer

MDX : how to calculate number of months between a date and beginning of the year?

Using iccube, I want to calculate the number of months between a date and the beginning of the year. I have 2 hierarchies in my date dimension : [Date de sortie].[Année, semestre, trimestre, mois, jour] : contains Year, half-year, quarter, month and…
Bertrand Miot
  • 929
  • 5
  • 12
1
vote
1 answer

mdx query to calculate average between date range

I am hoping to get some help to calculate the average between date ranges. Start date would be the time dimension and end date = start date - 13. Or is there a way we can use iff statement to calculate the average with date range?
SKenneth
  • 19
  • 11
1
vote
1 answer

MDX, The employee with the highest sales per product and year

I´m learning MDX and OLAP with Visual Studi and Management Sql Server Studio. Actually I make a cube "Sales" I´m tryig get "The employee with the highest sales per product and year" and I writed With MEMBER measures.[Maximun Sales] AS …
1
vote
1 answer

How to use greater than on date Hierarchy in MDX

I am new to MDX and I am trying to apply date filter to year of date Hierarchy , i.e. I want count of all sales for each product number excluding NA, for date greater than 1/1/2016. Write now I am using below query : SELECT NON EMPTY {…
user7739833
1
vote
1 answer

MDX Query performance issue when using DECENDANTS

I was using the below query without issues SELECT NON EMPTY { [Measures].[Value] } ON COLUMNS, NON EMPTY { ([Account].[Account List].[Account List].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION ON ROWS FROM [My Cube] There is a…
asb
  • 781
  • 2
  • 5
  • 23
0
votes
0 answers

MDX query not raising precise error message

I am trying to execute the following query on Power Pivot : SELECT NON EMPTY {[DimItemsGeneralData].[Item Code].[All], [DimItemsGeneralData].[Item Code].AllMembers} ON COLUMNS, NON EMPTY {[DimItemsGeneralData].[Gross Weight].[All],…
notarobot
  • 19
  • 2
0
votes
0 answers

MDX rolling months historical look back - set so that it is self updating as time lapses

Need to create a MDX section that looks back say 36 months based off current date in relation to a date column in the cube. Example: Admit Date is in the cube Need to check 36 months back based off current month year, instead of manually updating…
0
votes
1 answer

MDX equivalent Query for the below DAX CALCULATE query

I am trying to build a Measure using MDX that is equivalent to the following Power BI DAX calculation: CALCULATE( [Total Orders], 'Calendar Dimension'[LAST_WEEK_FLAG]=“1" )
0
votes
1 answer

How can I show the last opening period for each project in my project dimension hierarchy using MDX ( Tail function)?

I have two attributes hierarchies in my dimension [Dim Project]: Project Code Opening date Project A with 3 opening date : 2023-01-01 , 2023-01-02 and 2023-01-03 Project B with 2 opening date : 2023-01-02 , 2023-01-04 MDX query…
0
votes
1 answer

INNER JOIN between 2 $SYSTEM.TMSCHEMA_ tables using MDXQuery

I'm doing some queries in a SSAS model using SSMS and MDXQuery . I'm able to run a single select on any table as below: SELECT[TableID], [Name] FROM $SYSTEM.TMSCHEMA_PARTITIONS SELECT [ID], [Name] FROM $SYSTEM.TMSCHEMA_TABLES The first select…
Josh Sama
  • 33
  • 1
  • 5
0
votes
1 answer

how to get previous value in a fact table for a measure in mdx

I want to write an mdx query with a calculated Measure. Here is my fact table: How to implement a mesaure with the rule below : If CurrentAtt != PreviousAtt then PreviousValue else CurrentValue Thank you so much! any suggestion please ?
0
votes
1 answer

MDX Add Condition to filter for the first 6 month of the year

I would like to find the top 10 most profitable customers in the first six months of the year 2021 (January through June) sorted by profit in descending order. The following filter for all criteria except the months: SELECT [measures].[Profit] ON…
Marc
  • 588
  • 2
  • 15
0
votes
1 answer

UNION ALL of 2 MDX queries (within data cube)

I'm mdx rookie.. A box of gold for whoever can tell how to do UNION ALL of these two MDX queries: SELECT { [Measures].[P Count] } ON COLUMNS, { ( [Dim P View].[Person Key].[Person Key].ALLMEMBERS * [Dim P View].[Is Sensitive Data A].[Is Sensitive…
bishch
  • 5
  • 2
0
votes
0 answers

Trying to get a range of all months in 1998

I have been trying to use mdx querying to filter the monthly sales and year to date sales for only the months in 1998 This was my first trial: WITH MEMBER Measures.YTDSales AS SUM( PERIODSTODATE( [Time].Calendar.Year, …
0
votes
0 answers

Filtering MDX query with current month using Now() and "/"

I am very new to MDX, and am trying to write a query that will filter on the current month. Right now, my filter looks like the below: SELECT NON EMPTY { [Measures].[ACT_X_XXX_MTD_LOCAL_X_XX_A] } ON COLUMNS, NON EMPTY { ([DateOfPosting].[Posting…
Chris
  • 1
  • 1