Controlling meta data returned by an MDX query

Hello,
I'm retrieving results from Analysis Services then processing them further in SQL via OpenQuery. So I have a query of the form "select * from OpenQuery(LinkedServer, '<mdx>')
The query works fine, but because I have a dimension hierarchy with a seven levels on rows, the result set contains seven columns which I don't need, one column for each level in the hierarchy.
I can ignore them using the syntax "WITH CTE ([1],[2]...) as (<query>) ...", so this doesn't interfere with functionality.
However, I'm wondering if there is some syntax in MDX which will prevent those columns from being returned at all. I'm guessing that regardless of whether they are selected in SQL, that data still has to be processed. The performance impact of this isn't
noticeable on any single query, but it seems like for many queries with many rows it would add up. Is it possible to control the meta data that an MDX result set contains?
Thank you!

Hi vercinegetorix,
When we run MDX query by using OPENQUERY having hierarchy, we will get extra columns describing the values of each hierarchy level in different columns. This behavior is by design and we can't change that.
In addition, we may concern the attribute unique name a little long. The easiest way to remove them is to use an alias. For detail information, please refer to the article below:
MDX + T-SQL: Combining relational and multi-dimensional data into one query result set:
http://sqlblogcasts.com/blogs/drjohn/archive/2008/09/27/mdx-and-sql-combining-relational-and-multi-dimensional-data-into-one-query-result-set.aspx
If you have any feedback on our support, please click
here.
Elvis Long
TechNet Community Support

Similar Messages

  • Passing date range parameters in MDX Query

    Following is my mdx query
    SELECT NON EMPTY
        [Measures].[Cache Attendees Count]
    ON COLUMNS,
    NON EMPTY
        ([Cache Attendees].[Visit Id].[Visit Id].ALLMEMBERS *
        [Cache Attendees].[User Id].[User Id].ALLMEMBERS *
        [Cache Attendees].[Screen Name].[Screen Name].ALLMEMBERS *
        [Cache Attendees].[User Type Id].[User Type Id].ALLMEMBERS *
        [Cache Attendees].[User Type Name].[User Type Name].ALLMEMBERS *
        [Cache Attendees].[Group Date Count].[Group Date Count].ALLMEMBERS *
        [Cache Attendees].[Insert Time Stamp].[Insert Time Stamp].ALLMEMBERS )
        DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM
        SELECT
                STRTOMEMBER(@FromCacheAttendeesInsertTimeStamp) : STRTOMEMBER(@ToCacheAttendeesInsertTimeStamp)
            ) ON COLUMNS FROM (
            SELECT
                STRTOSET(@CacheAttendeesConferenceId) ) ON COLUMNS FROM [Cube_Attendee])
            WHERE ( IIF( STRTOSET(@CacheAttendeesConferenceId).Count = 1, STRTOSET(@CacheAttendeesConferenceId), [Cache Attendees].[Conference Id].currentmember ) )
    CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
    I want to filter my cube with three parameters
    1. @CacheAttendeesConferenceId
    2. @FromCacheAttendeesInsertTimeStamp
    3. @ToCacheAttendeesInsertTimeStamp
    When i pass following parameters
    ConferenceId = 1, StartDate='2010-01-28T00:00:00', EndDate='2010-02-03T00:00:00'
    Then it show records
    But When i pass following parameters
    ConferenceId = 1, StartDate='2010-01-27T00:00:00', EndDate='2010-02-03T00:00:00'
    Then it display message No Data Available
    PLease help me on this issue why not FromDate & ToDate range works properly.

    Step1:- First i create a SSAS datasource. Then i create a cube for my table CacheAttendees.
    It has following columns:-
    [Cache Attendees].[Conference Id]
    [Cache Attendees].[Group Date Count]
    [Cache Attendees].[Insert Time Stamp]
    [Cache Attendees].[Screen Name]
    [Cache Attendees].[User Id]
    [Cache Attendees].[User Type Id]
    [Cache Attendees].[User Type Name]
    [Cache Attendees].[Visit Id]
    Step2:- Then i create a dimension with this cube with all columns.
    Step3:- Then i deploy my SSAS project.
    Step4:- Use SSAS datasource in my SSRS datasource.
    Step5:- Create a report with chart control. Add a parameter ConferenceId. Set default to 1. When i preview my report then it show Cache Attendees].[Conference Id].[1] in header of report instead of that, When i pass the parameter value as 1 then report cannot show & throw an error. I want to pass this parameter at runtime.
    Step6:- Please help me how is it possible to pass parameter at runtime.

  • Date format with BW MDX Query driver

    Hi,
    I have a question regarding the BW MDX Query driver.
    I have updated the driver from BW Query to BW MDX Query on my crystal reports and all the Date fields have been converted to Strings. Has anyone experienced the same issue?
    Thanks,

    Hi Abhilash
    Thanks for the reply. We have two different environments and are using Crystal XI R2 and Crystal 11. We have installed SAP Integration toolkit XI R2 and SAP GUI 7.1 Patch 14. The date issue is appening in both environments.
    Does MDX supports Date fields/formats?
    Thanks,

  • No data return from BI7 via MDX drvier in Crystal report

    I have:
    Windows 2000 SP4
    SAP BI7 patch level 16
    SAP GUI 710 patch level 7 (BW3.5 addon patch 3, BI 710 patch 5)
    Crystal report XI R2 SP4
    SAP_Integration_Kit_XI R2-SP4
    and the BW tranports already imported in BI7.
    I can create a report over a Bex query in Crystal report using BW Query driver and retirved datafrom BI7
    Then I tried to create a report over the same Bex query in Crystal report using MDX driver, I got no data return from BI7.
    So I used the RSRTRACE transaction to trace the log when refreshing data in Crystal report, and then go to debug the call 10- GET_CELL_DATA and I have data from the MDX excution in BI7.
    So I think Crystal report can pass the MDX query to BI7 and BI7 can excute it without any problem, the issue is no data return to Crystal report.
    Could anyone help please?
    Thanks.

    [HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 11.5\SAP]
    "TraceDir"="C :\\Crystal Report\\"
    [HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 11.5\SAP\BW MDX Query Driver]
    "Trace"="Yes"
    "ExcludeSummaries"="Yes"
    Above are the right code in Reg and I have tried "C:\" as well, but still no trace file created.
    I was create the CR MDX report via SAP tool bar (and I create 2 reports base on the same Bex query with MDX and BW query just to compare, that one via BW query return data from BW)
    Thanks a lot.
    Allen
    Edited by: Wen Allen on Aug 25, 2008 5:32 PM

  • SSRS report with tabular model – MDX query CoalesceEmpty function does not return the provided string value

    Hello everyone,
    I created following calculated member in MDX query. I am using it in one of the report parameter in dataset (single select dropdown list as report parameter).
    WITH MEMBER [Measures].[ParameterCaption] AS
    CoalesceEmpty([Customer].[National Account Code].CURRENTMEMBER.MEMBER_CAPTION,'None')
    I would like to display 'None' text at the top of the dropdown list values. So that when user selects 'None' then this parameter will not considered in MDX query else the selected National Account Code will be considered to filter report data. But,
    the above return blank/empty value for  [Customer].[National Account Code].&  member though I specified 'None' as text in CoalesceEmpty function. Any advice would be appreciated.
    Thanks, Ankit Shah
    Inkey Solutions, India.
    Microsoft Certified Business Management Solutions Professionals
    http://www.inkeysolutions.com/MicrosoftDynamicsCRM.html

    Hi Ankit,
    It seems that you issue had been solved in your another thread.
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/5a5becac-226f-428a-95b0-aaaa22733818/ssrs-report-with-tabular-model-create-a-dropdown-report-parameter-with-none-option-as-the-top?forum=sqlanalysisservices#0e51bf8c-a66c-4df5-a244-0147728fdfdb
    iif([Customer].[National Account Code].CURRENTMEMBER.MEMBER_CAPTION="","None",[Customer].[National
    Account Code].CURRENTMEMBER.MEMBER_CAPTION)
    I marked this reply as answer, it will benefit to other members who have the similar issue.
    Regards,
    Charlie Liao
    TechNet Community Support

  • How to get the child data in MDX query?

    I have an MDX query that will return the data for an OLAP report. These report data include the parent_id, child_id and some dimensions data in it. How do I modify the MDX query to have a New member to show a dimension value of the child_id.
    The child_is is actually the parent_id on another row. It is the "Pstpd Decision" I want to be included in a new column using the "Appeal Id". Thanks
    WITH MEMBER [Measures].[Avg TA Time] AS [Measures].[Turn Around Time]/[Measures].[Number of Request]
    SELECT NON EMPTY { [Measures].[Number of Request] } ON COLUMNS,
    NON EMPTY { ([Request Date Time].[FY-AP].[Account Period].ALLMEMBERS *
    [Request Drugs].[Drug Generic Name].[Drug Generic Name].ALLMEMBERS *
    [Dispensary].[Dispensary Hierarchy].[Dispensary].ALLMEMBERS *
    [Disease].[Tumour Group Site].[Tumour Group Site].ALLMEMBERS *
    [Disease].[Tumour Group Sub Site].[Tumour Group Sub Site].ALLMEMBERS *
    [Patient].[Patient Agency ID].[Patient Agency ID].ALLMEMBERS *
    [Pstpd Decision].[Decision].[Decision].ALLMEMBERS *
    [Request].[Request Id Key].[Request Id Key].ALLMEMBERS *
    [Request].[Appeal Id].[Appeal Id].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS
    FROM ( SELECT ( { [Appeal Yes No].[Status].&[Yes] } ) ON COLUMNS
    FROM ( SELECT ( STRTOSET(@RequestDateTimeFiscalYear, CONSTRAINED) ) ON COLUMNS
    FROM [CAP Request])) WHERE ( IIF( STRTOSET(@RequestDateTimeFiscalYear, CONSTRAINED).Count = 1, STRTOSET(@RequestDateTimeFiscalYear, CONSTRAINED), [Request Date Time].[Fiscal Year].currentmember ), [Appeal Yes No].[Status].&[Yes] ) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
    data. 
    Kahlua

    I got it to work by adding the child_id's "decison' to the fact table as it is alot easier to get that data using Sql Script while creating the fact table and also there is already a "decsion" dimension setup. In the cube I can select the
    parent_id's decision and/or child_id's decision. It is working on the report. Thanks.
    Kahlua

  • Date parameters using MDX query

    Hello experts,
    Not sure if this question falls under SSAS or SSRS but I'm writing it here for now and hopefully get the answer.
    I'm using SSAS cube to develop a report using SSRS and this is the first time I'm doing it. I want to filter records based on date range and did some research online. My report contains two datasets:
    1. dsMain dataset -> it contains all the field which I want to use in the report and added a parameter thru query designed with following settings:
    Dimension : Dates
    Hierachary : Date
    Operator : Range (Inclusive)
    Parameters : checked
    it created two parameters called FromDatesDate and toDatesDate
    2. I created another dataset called dsDate and wrote a custom query (found at following link) and changed FromDatesDate and ToDatesDate using this date dataset
    https://jsimonbi.wordpress.com/2011/03/22/using-a-date-parameter-in-ssrs-with-mdx/
    Query for dsDate
    WITH
    MEMBER DateValue
    AS
       [Dates].[Date].CurrentMember.UniqueName
    MEMBER DateLabel
    AS
       [Dates].[Date].CurrentMember.Name
    SELECT
        [Measures].[DateValue],
        [Measures].[DateLabel]
    } ON 0,
         [Dates].[Date].[Date]
    } ON 1
    FROM [myCube]
    Here is the value returned by dsDate dataset (above query)
                            DateValue                          DateLabel
    06/04/1980 [Dates].[Date].&[29375]
    06/04/1980
    06/05/1980 [Dates].[Date].&[29376]
    06/05/1980
    06/06/1980 [Dates].[Date].&[29377]
    06/06/1980
    06/07/1980 [Dates].[Date].&[29378]
    06/07/1980
    06/08/1980 [Dates].[Date].&[29379]
    06/08/1980
    06/09/1980 [Dates].[Date].&[29380]
    06/09/1980
    06/10/1980 [Dates].[Date].&[29381]
    06/10/1980
    06/11/1980 [Dates].[Date].&[29382]
    06/11/1980
    06/12/1980 [Dates].[Date].&[29383]
    06/12/1980
    06/13/1980 [Dates].[Date].&[29384]
    06/13/1980
    Here is what I changed in FromDatesDate and ToDatesDate parmeter:
    Under Available Values tab:
    Dataset : dsDate
    Value Field : DateValue
    Label Field : DateLabel
    Here are my questions:
    1. I want to use date/time parameter so that user doesn't have to scroll thru whole date dimension.
    2. I changed the FromDatesDate and ToDatesDate to date/time parameter, removed the values from Available values tab and made the following changes on Parmaeters expression under dsMain dataset
    =”[Dates].[Date].&[” + Format(CDate(Parameters!FromDatesDate.Value),”MM/dd/yyyy”)
    + “T00:00:00]”
    =”[Dates].[Date].&[” + Format(CDate(Parameters!ToDatesDate.Value),”MM/dd/yyyy”)
    + “T00:00:00]”
    Now when I run the report I get following error:
    Query (1, 55) The restrictions imposed by the CONSTRAINED flag in the STRTOMEMBER function are violated.
    I think the reason is by changing parameter to date/time, now I cannot get "DateValue" which is required for the query.
    1. What is the best way to work with date parameters?
    Hope it is all clear and look forward to hear from experts.
    Thanks,
    P
    mark it as answer if it answered your question :)

    Hi Parry2k,
    In Analysis Services, a member can be referenced by either its member name or by its member key. The member key is used by the dimension to specifically identify a given member. The ampersand (&) character is used in MDX to differentiate
    a member key from a member name. In this scenario, the datetime is member name, not the member key. So you should not add "&".
    Reference:
    Member Names and Keys
    Simon Hou
    TechNet Community Support

  • MDX Query not retuern any data on my production server when i check service it is running

    Hi All,
    MDX Query not return any data  on my production server when i check service it is running. when i restart my service  i can able to run MDX Query and get data in my production server.

    Hi Mnishcal,
    According to your description, there is no data returned before restart Analysis Services, right?
    We haven't experiencing such issue before. And we cannot reproduce this issue. In your scenario, can you reproduce this issue? Here is a post which explains why you might not see the data you expect when browsing a SQL Server Analysis Services cube that
    processed successfully. Please refer to the link below.
    http://social.technet.microsoft.com/wiki/contents/articles/19744.ssas-troubleshooting-data-is-not-visible-when-browsing-a-cube.aspx
    Besides, are there any error on the log file? The msmdsrv.log file for the SSAS instance that can be found in \log folder of the instance. (C:\Program Files\Microsoft SQL Server\MSAS10.MSSQLSERVER\OLAP\Log)
    Regards,
    Charlie Liao
    TechNet Community Support

  • Need MDX query to find something like date diff and Date Range for last 10 days

    Hi ,
    I need two Query .First Query for below;
    I have below data in table like.
    Cat      StartDate    EndDate     
    A    2000-01-01     2000-01-15   
    B    2000-01-02     2000-01-30    
    C    2000-01-01     2000-01-31    
    D    2000-02-01     2000-02-28    
    A    2000-01-10     2000-01-31    
    I need if Startdate and Date completes whole one month then set status =1 else  0 using MDX query.
    like this ;
    Cat      StartDate    EndDate       Status
    A    2000-01-01     2000-01-15    1
    B    2000-01-02     2000-01-30    0
    C    2000-01-01     2000-01-31    1
    D    2000-02-01     2000-02-28    1
    A    2000-01-10     2000-01-31    1
    In second query I need last 10 days from current days like;
    Now = 8/20/2014
    output will be ;
    8/20/2014
    8/19/2014
    8/18/2014
    8/17/2014
    8/16/2014
    8/15/2014
    8/14/2014
    8/13/2014
    8/12/2014
    8/11/2014
    8/10/2014
    Please help me .
    Thanks

    Hi Prajapati,
    In your scenario, you can use Properties and Datediff function to achieve your requirement. Since not know the structure of your cube, we cannot give you the esact query.
     I have tested it on the AdventureWorks cube, the query below is for you reference.
    WITH MEMBER [Measures].[StartDate]
    AS
    [Employee].[Employee Department].CURRENTMEMBER.PROPERTIES('Start Date')
    MEMBER [Measures].[WorkYear]
    AS
    DATEDIFF('yyyy',[Measures].[StartDate],NOW())
    MEMBER [Measures].[Status]
    AS
    IIF(DATEDIFF('yyyy',[Measures].[StartDate],NOW())>10,1,0)
    SELECT {[Measures].[StartDate],[Measures].[WorkYear],[Measures].[Status]} ON 0,
    [Employee].[Employee Department].[Employee].MEMBERS ON 1
    FROM [Adventure Works]
    Results
    Reference
    http://msdn.microsoft.com/en-us/library/ms144821.aspx
    Regards,
    Charlie Liao
    TechNet Community Support

  • Adding a custom meta data field which lists out content id based on query

    How can we add a custom meta data filed which lists out content id based on query like dDocType <matches> `AssociatedProduct`?
    Or other alternative would be to have a custom metadata field such that it allows selection of content id using link wizard which we typically use in site studio. It would be preferable to have this second option as it is user friendly. Can we do this on a check-in screen?
    -Pratap

    Thanks for the reply Deepak.
    We got it resolved. We did following changes in /ucm/custom/SiteStudio/resources/ss_custom_field_resources.htm file and it worked cleanly.
    Added following section at the end before body tag
    ===================================================================================================
    <@dynamichtml ss_parent_definition_field_entry@>
         <$include super.std_edit_entry$>
         <$if isQuery and isTrue(isQuery)$></td><td><$endif$>
         <$include ss_contributor_base_scripts$>
         <script type="text/javascript" src="<$HttpRelativeWebRoot$>resources/<$SSContributorSourceDir$>/sitestudio/wcm.contentserver.popup.js"></script>
         <script language="JavaScript">
         function OnSelectParentId()
              var selectParentIdOptions = {};
              selectParentIdOptions.httpCgiPath = '<$HttpCgiPath$>';
              selectParentIdOptions.queryText = 'dDocType <matches> `Country`';
              selectParentIdOptions.coreContentOnly = '<$if coreContentOnly and isTrue(coreContentOnly)$>1<$else$>0<$endif$>';
              selectParentIdOptions.callback = function( returnParams )
                   returnParams = returnParams || {};
                   if( returnParams && returnParams['dDocName'] && ( returnParams.dDocName.length > 0 ) )
                        // Set the actual metadata value
                        <$if isQuery AND isTrue(isQuery)$>
                             for (var i=0; i < document.<$formName$>.elements.length; i++)
                                  var elt=document.<$formName$>.elements;
                                  if (elt.name=="<$fieldName$>")
                                       elt.value = returnParams.dDocName;
                        <$else$>
                             document.<$formName$>.<$fieldName$>.value = returnParams.dDocName;
                        <$endif$>
              WCM.ContentServerPopup.ChooseManagedDocument(selectParentIdOptions);
         </script>
         <input type="button" value="<$lc("wwBrowse")$>..." onclick="OnSelectParentId();">
    <@end@>
    ======================================================================================
    Then modified the section which show xWebsiteSection, xRegionDefinition etc to include my custom meta data defitnion as well ('xParentContentType')
    ===================================================================
    <@dynamichtml std_edit_entry@>
         <$if fieldName and ( fieldName like "xWebsites|xDontShowInListsForWebsites" )$>
              <$include ss_website_query_text_field$>
         <$elseif fieldName and strEquals( fieldName, "xWebsiteSection" )$>
              <$include ss_website_section_field_entry$>
         <$elseif fieldName and strEquals( fieldName, "xRegionDefinition" )$>
              <$include ss_region_definition_field_entry$>
         <$elseif fieldName and strEquals( fieldName, "xParentContentType" )$>
              <$include ss_parent_definition_field_entry$>
         <$else$>
              <$include super.std_edit_entry$>
         <$endif$>
    <@end@>
    ====================================================================
    This worked fine.
    Regards,
    Pratap

  • 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,

  • Failed to execute MDX query. Reason: returned server error (). (IES 10901) (WIS 10901).

    Hi,
    I am trying to create a Webi report based on an OLAP Universe. I am using BI 4.1 SP01
    I did the following:
    1. I have setup a databse connection for SAP SSM via the create connection wizard in the Universe Design Tool. My connection is created sucessfully.
    2. Next I created a Universe saved it and exported it.
    3. In webi I am trying to create a report, I selected a couple of measures in the "results objects" section. In the qurey filters section I selected month.
    When I run this query, I am getting an error message: Database error: Failed to execute MDX query. Reason: returned server error (). (IES 10901) (WIS 10901).
    I tried to search for similar issues reported on SCN forums and other places and it looks like a generic error and this was not answered in some of the discussions
    Any help is very much appricated.
    Thanks
    Imtiyaz

    Hi,
    I have verified in BEx query properties, it's "allow External Access to this Query" is checked.
    I have filter in BEx query, so not need to had it to query selection again in webi report.
    Could any other solution??
    Regards,

  • Meta Data About Query

    Hi Friends,
    If we create a query , where meta data about this query will be  stored ?
    was it stored in bi server ,if it stored how can we find?
    Thanks & Regards,
    Ramnaresh.P.

    Hi,
    Meta data means data about data
    it will show the technical information,description and graphical view of any object which is a part of Business content or activated objects in BW.
    The meta data will be stored in the meta data repository,
    To see the meta data > go to RSA1 > Meta data repository > you can see the Business content objects and activated objects.
    if you have a technical name for the query , you can find out and double click on the description of the query, for which you want to see the meta data and you can anlalyse here.
    you can also use RSRT t.code to see the information for the query.
    i hope it will be helpful for you
    Thanks and regards.
    Rambabu
    Edited by: RAMBABU VELANATI on Dec 22, 2008 4:24 PM

  • MDX query for to get the data from two cubes

    Hi
    Can you tell me how to create MDX query to get the values from two cubes.  (One hierarchy from first cube and one hierarchy from second cube)
    Can you give me one example.
    Regards,
    Madhu.
    Sudhan

    Hi Sudhan,
    According to your description, you want to retrieve data from two different cubes, right? The short answer is yes. To query multiple cubes from a single MDX statement use the LOOKUPCUBE function (you can't specify multiple cubes in your FROM statement).
    The LOOKUPCUBE function will only work on cubes that utilize the same source database as the cube on which the MDX statement is running. For the detail information about it, please refer to the link below to see the blog.
    Retrieving Data From Multiple Cubes in an MDX Query Using the Lookupcube Function
    Regards,
    Charlie Liao
    TechNet Community Support

  • Modify MDX query so it only shows specific dates?

    I'm new to SSAS and SSRS reports (with datasource an SSAS cube), so please bear with me.
    So I created a basic report that gets the data from my SSAS cube and displays it. That is working well. The problem is that the parameter displays the Dimension [Dim Date].[Date Key] so the dropdown displays every single day in the dimension table.
    One of my datasets in the report is a hidden dataset called [DimDateDateKey]. This is the dataset used to display all the values in the datekey dropdown parameter. The MDX query looks like this:
    WITH MEMBER [Measures].[ParameterCaption] AS [Dim Date].[Date Key].CURRENTMEMBER.MEMBER_CAPTION MEMBER
    [Measures].[ParameterValue] AS [Dim Date].[Date Key].CURRENTMEMBER.UNIQUENAME MEMBER
    [Measures].[ParameterLevel] AS [Dim Date].[Date Key].CURRENTMEMBER.LEVEL.ORDINAL
    SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS ,
    [Dim Date].[Date Key].ALLMEMBERS ON ROWS FROM [Sales cube]
    My question is, how can I modify this query so that it only displays dates that are between today and 5 days ago? The column [Dim Date].[Date Key] is of type INT, so it would only display 20141012 and 20141017.
    Currently, it displays every single [Dim Date].[Date Key] of the table, which is from 20000101 to 20201231.
    Thanks.
    VM

    Hi VM,
    you have to dynamically filter data based on current date. Current date you can get using VBA function now().
    I enclose code adjusted code sample you pasted, but because I don't have same cube as you do, I wasn't able to execute it. Anyway it should work or at least you should see there that principle
    WITH MEMBER [Measures].[ParameterCaption] AS [Dim Date].[Date Key].CURRENTMEMBER.MEMBER_CAPTION MEMBER
    [Measures].[ParameterValue] AS [Dim Date].[Date Key].CURRENTMEMBER.UNIQUENAME MEMBER
    [Measures].[ParameterLevel] AS [Dim Date].[Date Key].CURRENTMEMBER.LEVEL.ORDINAL
    SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS ,
    [Dim Date].[Date Key].ALLMEMBERS ON ROWS FROM
    (SELECT {StrToMember("[Dim Date].[Date Key].&[" + Year(now()) * 10000 + month(now()) *100 + day(now()) + "]"):
    StrToMember("[Dim Date].[Date Key].&[" + Year(now()-5) * 10000 + month(now()-5) *100 + day(now()-5) + "]")}
    ON COLUMNS FROM
    [Sales cube]
    Jiri Neoral

Maybe you are looking for

  • Scheduling agreement, unnecessary delivery schedule lines

    Hello We use Scheduling agreements for purchasing spare parts. The MRP run checks the warehouse requirements and creates delivery schedule line to scheduling agreement. Now the MRP run creates unnecessary delivery schedule lines to scheduling agreeme

  • VBox Guest Additions Kernel Modules

    Hey, semi-literate Linux user/Arch n00b here. I apologize in advance as I realize that this issue has been addressed in this forum previously, but after several hours of hunting, I have yet to find a proper solution. I am trying to run Arch64 as a gu

  • NuBee: Brushing in presets?

    I've just upgraded to the trial a3 and so far like (most of) what I see. I'd like to be able to brush in or brush away the effects of a preset from portions of an image and can't figure out if this is possible or is it strictly a whole image concept.

  • I have a macbook pro with a defunct Superdrive unable to install Snow Leopa

    Hi all, Does anyone know how I can get around this little problem. My drive won't take any disks at all and I want to install snow leopard.... I do have a .dmg image of the disk and I can mount it in my MacPro. But it keeps telling me it needs to be

  • On phone help

    Hi Gurus   I am new to BW did a small contract recently, now I got a permanent job but not confident enough with the technical things. Now I will be involving in BI.7, BPS, KPI's and Dashboards etc. I am looking for some one who can help me in ongoin