TechNet
Products
IT Resources
Downloads
Training
Support
Products
Windows
Windows Server
System Center
Microsoft Edge
Office
Office 365
Exchange Server
SQL Server
SharePoint Products
Skype for Business
See all products »
Resources
Channel 9 Video
Evaluation Center
Learning Resources
Microsoft Tech Companion App
Microsoft Technical Communities
Microsoft Virtual Academy
Script Center
Server and Tools Blogs
TechNet Blogs
TechNet Flash Newsletter
TechNet Gallery
TechNet Library
TechNet Magazine
TechNet Wiki
Windows Sysinternals
Virtual Labs
Solutions
Networking
Cloud and Datacenter
Security
Virtualization
Updates
Service Packs
Security Bulletins
Windows Update
Trials
Windows Server 2016
System Center 2016
Windows 10 Enterprise
SQL Server 2016
See all trials »
Related Sites
Microsoft Download Center
Microsoft Evaluation Center
Drivers
Windows Sysinternals
TechNet Gallery
Training
Expert-led, virtual classes
Training Catalog
Class Locator
Microsoft Virtual Academy
Free Windows Server 2012 courses
Free Windows 8 courses
SQL Server training
Microsoft Official Courses On-Demand
Certifications
Certification overview
Special offers
MCSE Cloud Platform and Infrastructure
MCSE: Mobility
MCSE: Data Management and Analytics
MCSE Productivity
Other resources
Microsoft Events
Exam Replay
Born To Learn blog
Find technical communities in your area
Azure training
Official Practice Tests
Support options
For business
For developers
For IT professionals
For technical support
Support offerings
More support
Microsoft Premier Online
TechNet Forums
MSDN Forums
Security Bulletins & Advisories
Not an IT pro?
Microsoft Customer Support
Microsoft Community Forums
Sign in
Home
Library
Wiki
Learn
Gallery
Downloads
Support
Forums
Blogs
Resources For IT Professionals
United States (English)
Россия (Pусский)
中国(简体中文)
Brasil (Português)
Skip to locale bar
Post an article
Translate this page
Powered by
Microsoft® Translator
Wikis - Page Details
First published by
ShankarGS
When:
17 Sep 2013 9:29 AM
Last revision by
Ed Price - MSFT
(aMicrosof)
When:
20 Sep 2013 4:43 PM
Revisions:
3
Comments:
1
Options
Subscribe to Article (RSS)
Share this
Can You Improve This Article?
Positively!
Click Sign In to add the tip, solution, correction or comment that will help other users.
Report inappropriate content using
these instructions
.
Wiki
>
TechNet Articles
>
Custom MDX Query for Excel Filters
Custom MDX Query for Excel Filters
Article
History
Custom MDX Query for Excel Filters
More Often we may want to write custom Filters for Cube Data retrieved through Excel. You can achieve it through VBA or simply by adding few iterations on Excel. We can Achieve Custom calculations by simply adding OLAP PIVOT TABLE Extension to EXCEL .
A common scenario would be building a 13 week rolling window for Pivot report on Excel.
1. Bring in your regular data through Excel and click on the Pivot area, In the options Pane select Fields, Items & Sets and select New/Manage Sets.
2. Now click Create sets using MDX and then Paste the code for the rolling window.
3. Sample Code for rolling Window
ClosingPeriod
(
[By Fiscal Calendar].[FP Week Of FP Month].[FP Week Of FP Month]
,[By Fiscal Calendar].[FP Week Of FP Month].CURRENTMEMBER
).Lag(NO of weeks to lag)
:
ClosingPeriod
(
[By Fiscal Calendar].[FP Week Of FP Month].[FP Week Of FP Month]
,[By Fiscal Calendar].[FP Week Of FP Month].CURRENTMEMBER
)
Give a Name for the "SET" and Save.
4. You will now Find the Set under your time dimension and select to use it for your pivot report.
5. You can repeat the same for other dimensions too. We can use Multiple Filters on the same Excel Book. The only limitation on this exercise is the whole code will reside on the excel workbook only.
Analysis Services
,
en-US
,
has code
,
has image
,
TechNet Guru
[Edit tags]
Leave a Comment
Please add 4 and 8 and type the answer here:
Post
Wiki - Revision Comment List(Revision Comment)
Sort by:
Published Date
|
Most Recent
|
Most Useful
Comments
Maheshkumar S Tiwari
17 Sep 2013 9:36 AM
Maheshkumar S Tiwari edited Original. Comment: Added tags and minor edit
Edit
Page 1 of 1 (1 items)
Wikis - Comment List
Sort by:
Published Date
|
Most Recent
|
Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
Posted by
Maheshkumar S Tiwari
on
17 Sep 2013 9:36 AM
Maheshkumar S Tiwari edited Original. Comment: Added tags and minor edit
Edit
Page 1 of 1 (1 items)