July 2003 MDX Puzzle

Use the FoodMart 2000 Sales cube to create an MDX query that finds the most recent nonzero sales amount for each customer in Los Angeles for each quarter of 1997. Format the quarters of 1997 on the columns and the individual customers in Los Angeles on the rows. In each cell, display the most recent monthly Store Sales value for that customer in that quarter. Here's a hint: This problem is very much like an inventory problem in which you want to aggregate the last known value for each time period. You need to create a measure that determines each time-dimension member's value by taking the value from the member's last non-empty child. Good luck! (You can read the solution to June's MDX puzzle on SQL Server Magazine's Web site at http://www.sqlmag.com, InstantDoc ID 39067.)

Please or Register to post comments.

IT/Dev Connections

Las Vegas
September 30th - October 4th

Paul ThurottOur Experts will show you:
• Common SQL Server
Problems
• Best Practices for T-SQL
• SQL Server Integration
Services
• Database Development

Come See Mike Otey & Tim Ford in Person!

Early Registration Now Open

From the Blogs
May 9, 2013
blog

My ISO 8601-Compliant Signature 2

My family recently just "officially" announced that we're in the process of adopting a child from South Africa. We're quite excited, of course, but there's a ton of paperwork to do—along with the need for gobs of signatures....More
May 8, 2013
blog

Use SSIS for ETL from Hadoop

In this blog post, Mark Kromer walks you through using SSIS as a way to use ETL techniques using Microsoft's Hadoop on Windows (HDInsight) as a source using Hive connectors...More
Vision road sign
May 6, 2013
blog

Cheaters Never Win, Even in TPC Benchmarks

In this portion of the series on database benchmarking, I want to tell you about one of my favorite aspects of the TPC benchmarks – CHEATING....More
SQL Server Pro Forums

Get answers to questions, share tips, and engage with the SQL Server community in our Forums.