question

Sonal avatar image
Sonal asked

How to write this TPCH query in MDX ?

SELECT TOP 10 L_ORDERKEY, SUM(L_EXTENDEDPRICE*(1-L_DISCOUNT)) AS REVENUE, O_ORDERDATE, O_SHIPPRIORITY FROM CUSTOMER, ORDERS, LINEITEM WHERE C_MKTSEGMENT = 'BUILDING' AND C_CUSTKEY = O_CUSTKEY AND L_ORDERKEY = O_ORDERKEY AND O_ORDERDATE < '1995-03-15' AND L_SHIPDATE > '1995-03-15' GROUP BY L_ORDERKEY, O_ORDERDATE, O_SHIPPRIORITY ORDER BY REVENUE DESC, O_ORDERDATE This is the query of tpch 3 but i want to write it in MDX.. i wrote it as SELECT {( TopCount([L_ORDERKEY].[L ORDERKEY].members, 11, [Measures].[REVENUE]), //TopCount({null:[Order_Date].[O ORDERDATE].&[1995-03-15T00:00:00]}, 11, [Measures].[REVENUE]), [O_SHIPPRIORITY].[O SHIPPRIORITY].&[0])} ON ROWS , ORDER([Measures].[REVENUE], [Measures].[REVENUE], DESC) ON COLUMNS FROM [TPCH3_CUBE] WHERE ( [C_MKTSEGMENT].[C MKTSEGMENT].&[BUILDING], {null:[L_ORDERDATE].[O ORDERDATE].&[1995-03-15T00:00:00]}, {[ShipDate_Q3].[L SHIPDATE].&[1995-03-15T00:00:00]:null} ) but there is one problem, in output .. no order date is shown! and i want order date in output as well.. PLEASE CAN ANYONE HELP ME ?
mdx
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.