Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: How to pass Parameter in MDX Query based on user selection

  1. #1

    Default How to pass Parameter in MDX Query based on user selection

    Hi,
    I had problem with passing parameter in MDX Query. I have found ParamRef() and Parameter() functions. But I didn't get so much of information wat i need.
    The following is my query

    with member [Store.Store].[AggregateValues] as 'Sum(Filter({[Store.Store].[All Store].[1].Children}, ([Store].CurrentMember IN {[Store.Store].[All Store].[1].[Haarlem], [Store.Store].[All Store].[1].[Leiden], [Store.Store].[All Store].[1].[Breda], [Store.Store].[All Store].[1].[Venlo]})))'
    member [Measures].[1st Pairs] as '((Sum({[Year.Year].[All Year].[2008].[6]}, Sum(Crossjoin({[PairIndicator.PairIndicator].[All pairindicator].[First Pair]}, {[Measures].[Frame Qty]}))) * 100.0) / Sum({[BrandName.BrandName].[All brandname].Children}, Sum({[Year.Year].[All Year].[2008].[6]}, Sum(Crossjoin({[PairIndicator.PairIndicator].[All pairindicator].[First Pair]}, {[Measures].[Frame Qty]})))))'
    select NON EMPTY {[Measures].[1st Pairs]} ON COLUMNS,
    NON EMPTY TopCount({[BrandName.BrandName].[All brandname].Children}, 5.0, [Measures].[1st Pairs]) ON ROWS
    from [SpecsaverSales]
    where ([PairIndicator.PairIndicator].[All pairindicator].[First Pair], [Store.Store].[AggregateValues])

    There I'm displaying Top 5 BrandNames. But the query should go according to the user selection. For suppose if the user selects 10 then it should display Top 10 BrandNames. So how can i pass the parameter .
    Any suggestions are welcome

    Thanks
    Annapurna

  2. #2
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    Just use {PARAMETER} and pass it on the input
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.