[Mondrian] How to dynamically group multiple range on dimension

Selina Tech swucareer99 at gmail.com
Tue Mar 15 20:14:50 EDT 2016


Dear All:
  I have a question on "How to dynamically group multiple range on
dimension".

 I have a dimension called age_dim and a measure called sum_count which is
sum of all count.  I have following two MDX query and get same result
listing all the sum_count for different ages.

SELECT
NON EMPTY {[Measures].[sum_count]} ON COLUMNS,
NON EMPTY {[age_dim].[count_hiera].[age].Members } ON ROWS
FROM [my_cube]


SELECT
NON EMPTY {[Measures].[sum_count]} ON COLUMNS,
NON EMPTY {
[age_dim].[count_hiera].[age].&[20] : [age_dim].[count_hiera].[age].&[29],
[age_dim].[count_hiera].[age].&[30] : [age_dim].[count_hiera].[age].&[39],
[age_dim].[count_hiera].[age].&[40] : [age_dim].[count_hiera].[age].&[49]
 } ON ROWS
FROM [my_cube]

age   sum_count
21     40
25     15
27     25
35     30
38     20
45     20
47     10


----------------
However I like to get table below which the sum_count can be grouped by
range of age dimension. Any Help would be great!

------------------
age   sum_count
20-29     80
30-39     50
40-49     30
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20160315/36ef8e17/attachment.html 


More information about the Mondrian mailing list