0
votes

I have the following query which should be returning income split by country and date. It should also be including a count of the number of dates in the grouping. This would be useful for a calculation looking at an entire month of income/days. I'm finding that the calculated measure is causing all countries in the dimension to be returned regardless of if there's any income data for it. Is there any way to limit this so only countries with income are returned?

with

MEMBER [Measures].[group_day_count] as

COUNT(

Descendants(

[Date].[Date].currentmember, [Date].[Date].[Date]

)

)

SELECT NON EMPTY Hierarchize({DrilldownLevel({[Date].[Date].[All]},,,INCLUDE_CALC_MEMBERS)}) DIMENSION PROPERTIES PARENT_UNIQUE_NAME,HIERARCHY_UNIQUE_NAME, [Date].[Date].[Date].[Date Sort] ON COLUMNS , NON EMPTY CrossJoin(Hierarchize({DrilldownLevel({[Source Location].[Country Code].[All]},,,INCLUDE_CALC_MEMBERS)}), {[Measures].[group_day_count],[Measures].[income]}) DIMENSION PROPERTIES PARENT_UNIQUE_NAME,HIERARCHY_UNIQUE_NAME ON ROWS
FROM (SELECT ({[Date].[Date].&[2017-10-04], [Date].[Date].&[2017-10-05], [Date].[Date].&[2017-10-06], [Date].[Date].&[2017-10-07], [Date].[Date].&[2017-10-08], [Date].[Date].&[2017-10-09], [Date].[Date].&[2017-10-10]}) ON COLUMNS FROM [Placeholder]) CELL PROPERTIES VALUE, FORMAT_STRING, LANGUAGE, BACK_COLOR, FORE_COLOR, FONT_FLAGS

1

1 Answers

0
votes

Try:

IIF([Measures].[Income],[Measures].[Days],NULL)