BookmarkSubscribeRSS Feed
Alexsander
Fluorite | Level 6

Hi All,

    I need help OLAP cube MDX query.

I have table with columns Product_Name, Year, Quarter, Sales_Amount etc. I can display these value in my cube.

I display the sales amount for particulate quarter, meaning the sales amount for quarter1 display in Q1, sales amount for quarter2 display in Q2, sales amount for quarter3 display in Q3 etc.

 

What I want is Q1 should show the particular quarter1 values.

whereas Q2 should show the values of quarter1 +quater2 values.

Q3 should show the values of quarter1 +quater2 + quater3 values.

Q4 should show the values of quarter1 +quater2 + quater3+ quater4 values.

 

Is it possible to do it through MDX query?

 

Note: The time hierarchy has both Year and Quarter.

 

Thank you in advance.

Best Rgards,

Alex

1 REPLY 1
AhmedAl_Attar
Rhodochrosite | Level 12

Hi ALex,

 

Have a look at this SGF paper How to Customize Your Data Analysis with SAS® OLAP Cube Calculations

It has a section about calculate accumulated total using the PeriodsToDate MDX function.

 

Additional papers can be found here SAS Technical Papers

 

Hope this helps,

Ahmed

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 834 views
  • 1 like
  • 2 in conversation