Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3963198
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:11:12+00:00 2026-05-20T03:11:12+00:00

Hi I have been playing around with MDX and need some very high-level getting-started

  • 0

Hi I have been playing around with MDX and need some very high-level getting-started type guidance. I already have a SQL-Server 2008 R2 DB up and running with data in it. I want to try something very simple in MDX to get familiar with the flow. I am not a DW or Cube expert so I need to start slow. (Facts/Dimenions are new to me)

I have a view from my relational DB that I wish to use as the single source for MDX. It’s simple:

TABLE WEEKLY_GAIN
  PCTGAIN (DECIMAL) -- The pre-calc'd pctg gain in price from day x to day x+1  
  DATE (DATE)       -- The date the stock pctgain was generated  
  WEEK(INT)         -- Contiguous/Consecutive integer that is keyed to the last trading day of each week.  
  YEAR (INT)        -- The year of the current PCTGAIN from the DATE column

Sample Data:

PCTGAIN          DATE           WEEK   YEAR  
0.01709791       2011-01-14     2      2011  
0.01102063       2011-01-07     1      2011  
0.0006922469     2010-12-31     52     2010  
0.01033836       2010-12-23     51     2010

I would like to use MDX to generate a cube and some functions (MEDIAN, MEAN, STDEV, etc). I have successfully identified the above view as a source in MDX. However I need help defining the (MDX) dimenions, keys, cube definitions, and whatever else needs to be done, etc.

I believe this should be straight forward (the date, WEEK, YEAR would be dimensions?) but I am not sure.

One “Cube” I would like to generate is…All of the years (1950-2011) are rows, all of the weeks (1-52) are columns and then generate some MIN, MAX, MED, aggregates of PCTGAIN for each week number across all years. I recognize there are ways to do this with T-SQL. However, I wish to do this in MDX to get the hang of setting MDX up and becoming productive with it.

I am happy to provide additional detail as needed. Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T03:11:13+00:00Added an answer on May 20, 2026 at 3:11 am

    There are some good resources for learning MDX at this question here: How to learn MDX

    With your final example it’s generally much easier to work with rows rather than columns for your periods so I’d recommend UNPIVOTing your table so each week is a rows and then building a date dimension with the right levels. Once that is done you’ll be able to use the MDX functions to calculate MIN, MAX, MED, PCTGAIN etc with relative ease.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been playing around with writing some simple card games in Python for
I have been playing around with the postgresql.conf file for a couple days now.
I have been playing around with the EF to see what it can handle.
I have been working with PostgreSQL, playing around with Wikipedia's millions of hyperlinks and
Recently I have started playing with jQuery, and have been following a couple of
Have been playing around with linq but there is one thing I cant seem
I have been playing around in expect recently and I for the life of
I have been playing around with a search control and i have noticed that
I have been playing around with Python's FTP library and am starting to think
I have been playing around with the MS Source Server stuff in the MS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.