?
Solved

How to sum over time period in MDX

Posted on 2008-10-29
3
Medium Priority
?
2,863 Views
Last Modified: 2013-11-16
I got time dimension based on DateTime column in fact table. Now i'am trying to build MDX query to sum fact rows on custom time periods. For example:

SELECT [Events Count] ON Columns, [20 seconds time periods] on Rows FROM [Common]

Result i expect:

                                             Events Count
2008-10-29 17:22:00                     1
2008-10-29 17:22:20                     2
2008-10-29 17:22:40                     1
2008-10-29 17:23:00                     56

How to build MDX query?
regards
Kuba F.
0
Comment
Question by:kubaf
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 8

Expert Comment

by:srnar
ID: 22838829
Use a new dimension with 60 members - one for each second. Map this dimension to your fact table. Then you can construct 3 custom sets e.g. {Second.[0]:Second.[19]}, {Second.[20]:Second.[39]}, {Second.[40]:Second.[59]} and put them on the row axes.
0
 

Author Comment

by:kubaf
ID: 22838856
srnar can you write sample MDX with sets? I'am kinda new in analysis services.
0
 
LVL 8

Accepted Solution

by:
srnar earned 2000 total points
ID: 22838925
Here is example on Adventure works that creates virtal members based on sets and puts them on the rows.
with set Decade01Set
as
	{[Date].[Fiscal].[Date].[July 1, 2001]:[Date].[Fiscal].[Date].[July 10, 2001]}
set Decade02Set
as
	{[Date].[Fiscal].[Date].[July 11, 2001]:[Date].[Fiscal].[Date].[July 20, 2001]}	
member [Date].Fiscal.Decade01
as
	aggregate(Decade01Set)
member [Date].Fiscal.Decade02
as
	aggregate(Decade02Set)
select Measures.Defaultmember on columns,
{[Date].Fiscal.Decade01, [Date].Fiscal.Decade02} on rows
from [Adventure Works];

Open in new window

0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question