reporting services - MDX SSRS Parameter category chooses all sub category -


i have been looking on stackoverflow , can't figure out. have dataset using ssas cube, , has 2 parameters. has category , subcategory.

i created datasets populate these parameters , work fine when select them both.

the way report runs is collection of subreports in table , grouped category , sub grouped subcategory. when select category parameter, lists each sub category sub reports.

what trying getting total of subcategories within category. tried using default values doesnt work. tried doing total on group within table doesn't work.
group g1 , subgroup sg1 , sg2), , sub reports sr1, sr2, goes this

g1

-total (sg1+sg2+sg3)
---sr1
---sr2

-sg1
---sr1
---sr2


-sg2
---sr1
---sr2

i able pull off sub group reports parts setting category parameter in sub reports parameter passed in category, , sub category parameter value of sub group. need darn total.

the mdx category

select { } on columns, { ([service].[category].[category].allmembers ) } dimension properties member_caption, member_unique_name on rows [sales-cube] cell properties value 

the mdx sub category

 select { } on columns, { ([service].[category].[category].allmembers * [service].[subcategory].[subcategory].allmembers ) } dimension properties member_caption, member_unique_name on rows [sales-cube] cell properties value 

the mdx dataset using parameters created using designer , follows

select non empty { [measures].[sales count] } on columns,  non empty { ([date].[fiscal year].[fiscal year].allmembers ) } dimension properties member_caption, member_unique_name on rows  ( select ( filter( [service].[subcategory].[subcategory].allmembers, instr( [service].[subcategory].currentmember.properties( 'member_caption' ), @paramsubcategory )  > 0  ) ) on columns  ( select ( filter( [service].[category].[category].allmembers, instr( [service].[category].currentmember.properties( 'member_caption' ), @paramcategory )  > 0  ) ) on columns  [sales-cube])) cell properties value, back_color, fore_color, formatted_value, format_string, font_name, font_size, font_flags 

so based on selected category, filter subcategory within category cascades. resources or great.

as said in comments cannot use name of member slice cube in mdx, have use unique name instead. have handle when user selects category x , category y paramcategory parameter, should set [service].[category].&[category x] , [service].[category].&[category y]. i'd do.

i'd use mdx script returns label (name) , unique name populate category.

with member [measures].[category label]   [service].[category].currentmember.name member [measures].[category uniquename]   [service].[category].currentmember.uniquename select { [measures].[category label], [measures].[category uniquename] } on columns, {} on rows [sales-cube] 

in parameter properties / available values have use category label field label field , category uniquename value field.

the same apprach populate paramsubcategory.

with member [measures].[subcategory label]   [service].[subcategory].currentmember.name member [measures].[subcategory uniquename]   [service].[subcategory].currentmember.uniquename select { [measures].[subcategory label], [measures].[subcategory uniquename] } on columns, { [service].[subcategory].[subcategory] } on rows [sales-cube] ( strtoset ( @paramcategory ) ) 

note using paramcategory populate paramsubcategory related subcategories.

now can use parameters in mdx script:

select non empty { [measures].[sales count] } on columns, non empty {   ( [date].[fiscal year].[fiscal year].allmembers ) } dimension properties member_caption, member_unique_name on rows (   select ( strtoset( @paramsubcategory ) ) on columns   (     select ( strtoset ( @paramcategory ) ) on columns     [sales-cube]   ) ) cell properties value, back_color, fore_color, formatted_value, format_string, font_name, font_size, font_flags 

note filter , instr function not requerid since passing unique name members.

it not tested should work, luck!

let me know if helps.


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -