Crossjoin using MDX in ssrs

You will need to return the data as a cross join between member number, business segment and sales rep hierarchy and then use a case statement on the report side to do the groupings based on this logic. The name column is what will display to the user. Use
the code instead of descriptions for the case statement. For example, Rental would be…
[MEMBER].[SALES REP HIERARCHY].[DIRECTOR].&[11566] + [MEMBER].[BUSINESS SEGMENT DESC].&[05]
Name
MEMBER - SALES REP HIERARCHY - DIRECTOR
MEMBER - BUSINESS SEGMENT
MEMBER -  MEMBER NBR
Retail Consultant
Robert
<> 25002
Internal Growth Consultants
CUSIMANO, LOU
Strategic Alliance Accounts
BLAIR, JASON
International
HYBEL, LARS
MRO
CRAWLEY, KEITH
Rental
LANE, ERIC
RENTAL
HG&S
LANE, ERIC
HOME & GARDEN
Ecommerce
and what will be the switch statement (calculated field)

try this. Don't let cube decide the unknown member. In the Region dimension view/ source query, use the UNION  to add key = 0 and name = Unknown. this way, u r defining the unknown member in the data. not in the cube. and don't forget to change the
dimension property Unknown Member  = None.
All the best.
prajwal kumar potula

Similar Messages

  • How to create SSRS repot using MDX

    Hello, 
    Can any body let me know how to create SSRS reports using MDX query

    Hi Sanjay_S,
    Take a look into
    Build SSRS Report using MDX
    Aftab Ansari

  • How to get period date of for a given month from a given date in mdx for SSRS report (mm/dd/yyyy)

    I have a situation,  where i need to write expression Period to date(PTD). i want to know how to get the period date. i want you to help in writing Period date or else is there any function to get period date for a given date(the  date is given
    from the parameter dynamically) in MDX for SSRS report
    ram

    Hi ram,
    Per my understanding that you want to get the period date based on the month selected and the given date, right?
    Could you please provide details information below to help us better understanding your requirements, thus we will be more effective to provide an solution:
    What is the format of the period date you want to get, is this date in the DB and you want to filter it based on the month and the given Date?
    Did the month and given date are two parameters in the report? if possible, could you please provide some sample data in the DB and also the snapshot of the report structure
    I assume you want to get the period date(mm/dd/yyy) between the select month(e.g:Feb) and the given date (10/1/2014) and you should get the date between(02/01/2014-10/1/2014).
    If so,and you also have two parameter "Month","EndDate"(EndDate is the given date), please reference to details information below:
    You can create an new parameter "BeginDate" (Date/Time) which is the begin date of the period, you can use the expression to get the value based on the value of the month and the year value from the given date,finally hide this parameter:
    Specify the available value:
    Label:=Parameters!Month.Value &"/01/"& DatePart("yyyy",Parameters!EndDate.Value)
    Value:=CDate(=Parameters!Month.Value &"/01/"& DatePart("yyyy",Parameters!EndDate.Value))
    Specify the default Value:
    Value:=CDate(=Parameters!Month.Value &"/01/"& DatePart("yyyy",Parameters!EndDate.Value))
    Add filter to the dataset as below:
    Preview you will get all the date in the given Period:
    If you still have any problem, please feel free to ask.
    Regards
    Vicky Liu

  • ASO data slice export using MDX

    Hi
    Can any one help in syntax for exporting data slice from ASO cube using Mdx and Maxl?

    spool
    http://docs.oracle.com/cd/E17236_01/epm.1112/esb_tech_ref/frameset.htm?maxl_commands_spool.html
    ogin test test on test;
    Spool on to 'mxlDefectAll.txt';
    set column_width 36;
    SELECT NON EMPTY {( [Actual])} ON COLUMNS,
    NON EMPTY
    CrossJoin (CrossJoin ([Product].children, [Market].children),
    CrossJoin([Year].Children, [Measures].children))
    ON ROWS
    FROM Sample.Basic
    spool off;
    logout;
    or use maxl-perl interface
    http://docs.oracle.com/cd/E17236_01/epm.1112/esb_tech_ref/frameset.htm?maxl_perl_examples.html

  • Combine two resultset sidebyside in coulmn using mdx

    hi i am new to mdx,
    i want to combine two select statement resultset (side by side like union) using mdx query,please any body help me to solve this query
    first query:
     SELECT
    { [Last Year] }
    ON COLUMNS,
     { {[Location].[Location].&[7], [Location].[Location].&[12], [Location].[Location].&[11],
    [Location].[Location].&[19], [Location].[Location].&[17], [Location].[Location].&[16],
    [Location].[Location].&[9], [Location].[Location].&[18] },{[Location].[Location].[All]}}
    ON ROWS
    FROM [Cube1]
    WHERE ( [Measures].[Labour %] )
    here [Last Year] is a calculated set
    {STRTOMEMBER("[Date].[Month].&["+ cstr(year(now())-2) +"-11-01T00:00:00]"):
            (STRTOMEMBER("[Date].[Month].&["+ cstr(year(now())-1) +"-10-01T00:00:00]"))}
    2nd query:
    WITH MEMBER [Measures].[Budget ] AS IIF(avg([Last Year],IIF(([Measures].[Budget]>0),[Measures].[Budget],null)),
                                            avg([Last Year],IIF(([Measures].[Budget]>0),[Measures].[Budget],null)),0.00),
    MEMBER [Measures].[YTD] AS IIF(avg([Last Year], IIF(([Measures].[Labour %]>0),[Measures].[Labour %],null))<>null,
                                  avg([Last Year], IIF(([Measures].[Labour %]>0),[Measures].[Labour %],null)),0.00),
    FORMAT_STRING = "Standard",
    BACK_COLOR = CASE WHEN [YTD] = 0  THEN /*White*/16777215 /*White*/  
    WHEN [YTD] <= [Measures].[Budget ] THEN 65408
         WHEN [YTD]<= [Measures].[Budget ] +5 THEN 65535
         WHEN [YTD]> [Measures].[Budget ] +5 THEN 255
    END,
    VISIBLE = 1
    SELECT
    {  [Measures].[YTD], [Measures].[Budget ] }
    ON COLUMNS,
    { { [Location].[Location].&[7], [Location].[Location].&[12], [Location].[Location].&[11], [Location].[Location].&[19], [Location].[Location].&[17], [Location].[Location].&[16], [Location].[Location].&[9], [Location].[Location].&[18]
    },{[Location].[Location].[All]} }
    ON ROWS
    FROM [Cube1]
    here   ==> [Measures].[YTD], [Measures].[Budget ] are calculated member
    i want result like in
    coulmns===> ytd,budget,nov,dec,jan,feb.,,,,,,,,,,out
    rows ====> are only locations and total(average of all locations)
    please guide me to get solution like mdx query

    Hi Vsp,
    According to your description, you want to create a calculated member to combine two members, and then set it as Default member, right?
    In SQL Server Analysis Services, we can use the script below to create a calculated members.
    create member currentcube.[Date].[Day of Week].[weekend]
    as
    {[Date].[Day of Week].&[6],[Date].[Day of Week].&[7]
    Every attribute in a dimension in Microsoft SQL Server Analysis Services has a default member, which you can specify by using the
    DefaultMember property for an attribute. This setting is used to evaluate expressions if an attribute is not included in a query. Please refer to the link below to see the detail information about specify a default member.
    http://technet.microsoft.com/en-us/library/ms174822(v=sql.105).aspx
    Regards,
    Charlie Liao
    TechNet Community Support

  • Except function with parent child hierarchy using mdx query

    HI,
    I need to remove some items using mdx query in parent child hierarchy.
    I tried with below query,it is not removeing ,could you please help me.
    SELECT
    {[Measures].[Amount]} ON
    COLUMNS
     NonEmpty([Account].[Accounts].[Account Level 01],[Measures].[Amount])
    ON ROWS
    FROM (SELECT
    -Descendants({[Account].[Accounts].&[47]},,Leaves)
    } ON COLUMNS
    FROM [Adventure Works])
    indu

    Hi Indu,
    Why do you remove some itmes using
    Descendants function? Generally, we use FILTER function to achieve the requirement.
    WITH SET [CustomAccounts] AS
    FILTER ([Account].[Accounts].[Account Level 01].Members , [Account].[Accounts].CurrentMember.Name<>'Net Income')
    SELECT {[Measures].[Internet Sales Amount]} ON 0
    [CustomAccounts] ON 1
    FROM [Adventure Works]
    WITH SET [CustomAccounts] AS
    FILTER ([Account].[Accounts].[Account Level 01].Members , [Account].[Accounts].CurrentMember.Name='Net Income')
    SET [RemainingAccount] AS
    [Account].[Accounts].[Account Level 01]- [CustomAccounts]
    SELECT {[Measures].[Reseller Sales Amount]} ON 0
    [RemainingAccount] ON 1
    FROM [Adventure Works]
    Results.
    References.
    http://www.databasejournal.com/features/mssql/article.php/3306101/MDX-Essentials-Basic-Set-Functions-The-Filter-Function.htm
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/c0149678-97f2-4066-903f-7f9e9ff09b56/filtering-out-dimension-members-with-mdx?forum=sqlanalysisservices
    Regards,
    Charlie Liao
    If you have any feedback on our support,
    please click here.
    Charlie Liao
    TechNet Community Support

  • IIf condition between dates using mdx query

    Hi,
    how to check IIF condition between dates using mdx query.
    I able to check single year,plese check below mdx query.I need to check members between years.
    my requirement is member is belongs to between years(2007 to 2010),display "yes" else "NO";
    Could you please give me exact mdx query.
    From,to-2007,2010,if member belongs to 2007to 2010 then disply "yes"else "no".
    how to pass two members in IIf condition.
    WITH
    MEMBER Measures.[test]
    AS Iif([Date].[Calendar Year].currentmember
    is [Date].[Calendar Year].&[2007],"no","yes")
    SELECT {Measures.[test]}
    on 0
    ,[Product].[Subcategory].[Subcategory].MEMBERS * [Date].[Calendar Year].[Calendar Year]
    ON 1
    FROM [Adventure Works]
    indu

    Hi Sriindu,
    consider the following:
    WITH
    MEMBER measures.[test] AS
    IIF
    Exists
    [Date].[Calendar Year].CurrentMember
    [Date].[Calendar Year].&[2007] : [Date].[Calendar Year].&[20010]
    ).Item(0)
    IS
    [Date].[Calendar Year].CurrentMember
    ,"yes"
    ,"no"
    SELECT
    {measures.[test]} ON 0
    [Product].[Subcategory].[Subcategory].MEMBERS
    [Date].[Calendar Year].[Calendar Year] ON 1
    FROM [Adventure Works];
    Philip,

  • Using mdx query from Java Apache

    Please suggest/guide me how to use MDX query to pull data from cube from Apache JAVA??
    BI GUY

    Hi BIGUY,
    Multidimensional Expressions (MDX) is the query language that you use to work with and retrieve multidimensional data in Microsoft Analysis Services. MDX is based on the XML for Analysis (XMLA) specification, with specific extensions for SQL Server Analysis
    Services.
    According to your description, it's hard to give your the exact MDX query to pull the data which you want from the cube since there are no any detail information about the cube. Here are some basic knowledge for your reference.
    Querying Multidimensional Data with MDX
    MDX Sample
    Regards,
    Charlie Liao
    TechNet Community Support

  • Can we Implement YTD using MDX syntax in olap universe.

    Hi,
    I am trying to implement YTD prompt from universe level. Can any one suggest how can i implement it using MDX syntax in olap universe.
    Regards,
    Anil Kumar.

    Hi,
    In MDX, you need to generate the technical name to have you expression valid.
    Moreover the correct syntax is: SUM(MTD(member),measure)
    So in your case the prompt must be constrained on the technical name and cannot be free, the correct syntax is:
    <EXPRESSION> SUM(MTD(@Prompt('YYYYMM','A','Cal. year / month\L01 Cal. year / month',mono,primary_key)),
    @(Select(Key Figures\Total Variance)) </EXPRESSION>
    Last, the result will be not really significant because you are asking for a MTD with a Year-Month as time member: the result will be the measure value for the selected month.
    In your case you need to have a time series function for an upper level like YTD or QTD. If you want to use MTD, the the time member selected would be at a lowest level, such as week or day.
    Regards
    Didier

  • How to use stripline in ssrs line chatrs

    Hi,
    I want to know how to use striplines in ssrs line charts?

    Hi ,
    You can use below link;
    https://msdn.microsoft.com/en-us/library/dd239316.aspx?f=255&MSPPError=-2147217396
    https://sqlserverbiblog.wordpress.com/tag/strip-line/
    http://blogs.adatis.co.uk/blogs/jeoc/archive/2013/07/23/adding-strip-lines-to-reports.aspx
    Thanks
    Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem. http://techequation.com

  • Creating buckets by comparing Dimension member against Measure using MDX

    I have a Product dimension which has hierarchies - product_id, initial_price, product_name, category and Measures - units_sold, cost_per_unit, revenue_per_unit. For each product_id I need to compare initial_price against revenue_per_unit and then assign it
    to a bucket based on the comparison. 
    Consider the following example:
    Input:
    product_id   initial_price revenue_per_unit
    1               10  
               12
    2               20  
               18
    3               30  
               35
    And if Product 1, 2 are in Category Book and 3 in Clothes then output should look like
    Output:
    Category  revenue type        Amount
    Book               Profit                
     2
                          Loss            
           2
    Clothes           Profit                   5
                          Loss                     0
    How can I achieve this using MDX?

    Hi Vijay,
    In your case, I couldn't found the "revenue type" attribute in the "Product" dimension. If you need to get the expected result, I suggest you calculate the amount at underlying data souce, and then retrieve the result set via MDX.
    Regards,
    Elvis Long
    TechNet Community Support

  • Can I have multiple TFS instances use a single SSRS installation

    Can I have multiple TFS instances use a single SSRS installation?
    Thanks

    Hi Kim,
    According to your description, you have multiple TFS instances using one Reporting Services instance. Right?
    For installing TFS, to use a named instance with Team Foundation Server, you must install SQL Server by using a named instance, or move or restore Team Foundation Server data to a named instance, or create a team project collection on a named instance. Please
    refer to the link below:
    Work with SQL Server Named Instances
    Reference:
    Understanding SQL Server and SQL Server Reporting Services
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • Allocations using MDX in ASO?

    Can allocations be done in an Essbase ASO application using MDX calc scripting? If so, is it worth moving to it considering the work involved? It is fairly easy to develop and support in BSO applications. Thanks.

    Hi Hiren,
    According to your description, you will not select Country, State & City at the same time, right?
    So as per my understanding, you needn't to create the hierarchy, just create three attributes Country, State and City. Then when you select one of the attributes in the PowerPivot table, the attribute can be the filter which you can see on the screenshot
    below.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Error extracting data from essbase cube using MDX method

    Hi,
    We have some problems extracting data from essbase cube using MDX method, we believe that the problem is the MDX query, this is the problem and query:
    ERROR:
    [DwgCmdExecutionThread]: Cannot perform cube view operation. Analytic Server Error(1260046): Unknown Member SELECTNON used in query
    com.hyperion.odi.essbase.ODIEssbaseException: Cannot perform cube view operation. Analytic Server Error(1260046): Unknown Member SELECTNON used in query
         at com.hyperion.odi.essbase.wrapper.EssbaseMdxDataIterator.init(Unknown Source)
    MDX:
    SELECT
    NON EMPTY {[YearTotal].[Jan]} ON COLUMNS,
    NON EMPTY {[Total Movimientos].[Presupuesto Base]} ON AXIS(1),
    NON EMPTY {[Año].[FY11]} ON AXIS(2),
    NON EMPTY {[Escenario].[Presupuesto_1]} ON AXIS(3),
    NON EMPTY {[Version].[Trabajo]} ON AXIS(4),
    NON EMPTY {[Moneda].[Moneda Input]} ON AXIS(5),
    NON EMPTY {[Centros de Costo].[1101]} ON AXIS(6),
    NON EMPTY {Descendants([Resultado Operacional],4)} ON AXIS(7)
    FROM [DSR02].[ROP]
    We try extract data using a sample cube and work fine, this is the mdx query:
    SELECT
    {[Actual],[Budget]} ON COLUMNS,
    {[Sales]} ON ROWS,
    NON EMPTY {[Product].levels(0).members} ON PAGES,
    NON EMPTY {[East].levels(0).members} ON AXIS(3),
    NON EMPTY {[Year].levels(0).members} ON AXIS(4)
    FROM Sample.Basic
    The model reversed ([DSR02].[ROP]) have the same structure than query need, the query and the model are fine, definitely we can´t see the problem, someone can help us?
    Regards

    You will be able to test the MDX query in EAS, it is usually best to test the query first before trying to use it in ODI.
    Is there any reason you are using MDX to extract the data, have you tried reportscript as I usually find it more efficient to extract the data.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • SSRS report using mdx query to display sales of product by yearwise

    There is a requirement to create SSRS report as 
    Product                         +Calender2011               -Calender 2012            +Calender 2013      
             + Calender 2014
    Jan12 Feb12 Mar12...
    Product 1 50    100       200 ..
    Product 2 150    900       200 ..
    Product 3 250    180       900 ..
    Product 4 450    100       200 ..
    Product 5 50    100       200 ..
    Product 6 50    100       200 ..
    When I click on Calender2011 corresponding all months of 2011 has to appear and likewise for Calender2012, CalenderN 
    The MDX query I have like as follows-
    Select    Non Empty{
    [Measures].[Product1], 
     [Measures].[Product2], 
     [Measures].[Product3], 
     [Measures].[Product4],
      [Measures].[Product5], 
      [Measures].[Product6], 
      [Measures].[Product7], 
      [Measures].[Product8], 
      [Measures].[Product9], 
      [Measures].[Product10], 
      [Measures].[Product11], 
       } ON Rows ,
       Non Empty  { ([Dim Calendar H].[Year Name].[Year Name] ) *([Dim Calendar H].[Month name].[Month name])
     ON COLUMNS
      FROM ( SELECT ( { [Dim Calendar H].[Year Name].&[Calendar 2014], 
     [Dim Calendar H].[Year Name].&[Calendar 2013], 
     [Dim Calendar H].[Year Name].&[Calendar 2012], 
     [Dim Calendar H].[Year Name].&[Calendar 2011] } ) 
     ON COLUMNS 
     FROM [Cube]) 
    Please help me. 
    Advance thanks...

    Hi Afans,
    According to your description, you want to create a drill-down report using SQL Server Analysis Services database, right?
    In this case, you need add the Year and Month fields to the column group, and set the Month column can be toogled by Year column group. I have teste it on my local environment, here is the sample query for your reference.
    select [Measures].[Internet Sales Amount] on 0,
    [Product].[Category].members*[Date].[Calendar].[Calendar Year].members*[Date].[Month of Year].members on 1
    from
    [Adventure Works]
    Reference
    http://popbi.wordpress.com/2012/03/02/ssrs-how-to-add-a-column-group-to-an-existing-table/
    http://msdn.microsoft.com/en-IN/library/dd207042.aspx
    Regards,
    Charlie Liao
    TechNet Community Support

Maybe you are looking for