Forum Discussion
Anonymous
6 years agoNot applicable
Adding date table to mdx query
Hello In my last post I asked how to correctly pull data using MDX filtering and got everything working. Code that helped me filter out and format it just how I needed: SELECT
NON EMPTY {[Proj...
- 6 years ago
Hi Anonymous ,
try this ...
SELECT NON EMPTY {({[Project POS].[Type hierarchy].[WinPOS], [Project POS].[Type hierarchy].[SelfCheckout]} * [Time].[Time].[Calendar Year].&[2020])} ON COLUMNS, NON EMPTY {[Project POS].[POS hierarchy].[Project]} ON ROWS FROM (SELECT ({[Time].[Time].[Calendar Year].&[2020]}) ON COLUMNS FROM [Property Cube]) WHERE ([Measures].[Count of Receipts])
mwegener
6 years agoMost Valuable Professional
Hi Anonymous ,
try this ...
SELECT
NON EMPTY {({[Project POS].[Type hierarchy].[WinPOS], [Project POS].[Type hierarchy].[SelfCheckout]} * [Time].[Time].[Calendar Year].&[2020])} ON COLUMNS,
NON EMPTY {[Project POS].[POS hierarchy].[Project]} ON ROWS
FROM
(SELECT ({[Time].[Time].[Calendar Year].&[2020]}) ON COLUMNS
FROM [Property Cube])
WHERE ([Measures].[Count of Receipts])
Anonymous
6 years agoNot applicable
Thanks that helped 🙂
Final code that does everything I need:
SELECT
NON EMPTY {({[Project POS].[Type hierarchy].[WinPOS], [Project POS].[Type hierarchy].[SelfCheckout]} * {[Time].[Time].[Month].&[202001], [Time].[Time].[Month].&[202002], [Time].[Time].[Month].&[202003], [Time].[Time].[Month].&[202004], [Time].[Time].[Month].&[202005], [Time].[Time].[Month].&[202006], [Time].[Time].[Month].&[202007], [Time].[Time].[Month].&[202008], [Time].[Time].[Month].&[202009],[Time].[Time].[Month].&[202010], [Time].[Time].[Month].&[202011], [Time].[Time].[Month].&[202012]})} ON COLUMNS,
NON EMPTY {[Project POS].[POS hierarchy].[Project]} ON ROWS
FROM (SELECT ({[Time].[Time].[Calendar Year].&[2020]}) ON COLUMNS FROM [Property Cube]) WHERE ([Measures].[Count of Receipts])