mdx

MDX - Converting Member Value to CDate

若如初见. 提交于 2019-12-24 14:50:13
问题 I need to convert a member value from this format dd.MM.yyyy into a CDate. This was my trial: cdate(format([Date].[Date].CURRENTMEMBER.MEMBER_VALUE, "dd.MM.yyyy")) Source: http://www.datazen.com/blogs/post/working-with-dates-in-datazen-3-0 However, I get a type mismatch error, because the format function ist not working properly. I'm using a Microsoft Analysis Server. Do someone know a solution for this issue? 回答1: You need to create a measure when to extract the date. Here is a possible

MDX where Date is less than now

柔情痞子 提交于 2019-12-24 12:29:51
问题 This is my code below...... SELECT { [Measures].[ACPPurchaseValue] } ON COLUMNS ,( [Date].[YYYYMMDD].[YYYYMMDD] ) ON ROWS FROM [Kahuna] WHERE ( [Reporting Currency].[reportingCurrency].&[1] ,strToSet(@MdxBOSP) ,strToSet(@MdxVIPType) ,strToSet(@MdxHost) ,strToSet(@MdxOperatorName) ); How can I say where [Date].[YYYYMMDD].[YYYYMMDD] < getdate() 回答1: You need to initially create a member, or a single member set, that corresponds to today. The following looks a little complex but is actually a

MDX query - best salesmen who sold all of given products

好久不见. 提交于 2019-12-24 10:40:58
问题 Let's say I have two simple dimensions: Products - with id and name Salesmen - with id and name My fact table is named SALES and contains the ids of the abovementioned. I need to produce a query that will show the names of salesmen who sold all of the given products. This code solves the problem for two items X and Y: SELECT {} on 0, EXISTS( EXISTS( {[Salesmen].[Name].MEMBERS}, {[Products].[Name].&[X]} ) ,{[Products].[Name].&[Y]} ) ON 1 FROM [Test]; The other version is: SELECT {} on 0,

Using the ANCESTOR function on a DATE dimension

て烟熏妆下的殇ゞ 提交于 2019-12-24 09:37:30
问题 Here is my script: WITH MEMBER [Date].[Date - Calendar Month].[2MthPrev] AS ( ANCESTOR( CLOSINGPERIOD([Date].[Date - Calendar Month].[Calendar Month]), 2 )) SELECT NON EMPTY { [Date].[Date - Calendar Month].[2MthPrev] } ON ROWS, NON EMPTY [Measures].[Revenue] ON COLUMNS FROM [OurCube] The query runs with no error but the result pane is empty. I've attempted to create a custom member in the [Date - Calendar Month] hierarchy that is two months previous to the last month in the hierarchy's level

MDX query from PHP

丶灬走出姿态 提交于 2019-12-24 09:27:43
问题 Is it possible to create an MDX query for JasperServer using PHP as a host language, given that my underlying relational database is MySQL? What I would like to do is send the query to JasperServer in order to create an OLAP View and receive the view as a result (preferably in some text-based format, as oposed to an image or PDF). I'm using JasperServer CE 4.2.1. As a side note, is it even correct to think about making MDX queries from you application, just like you would make SQL queries? If

mdx - how to replace null values with '0' in measures members

会有一股神秘感。 提交于 2019-12-24 08:47:50
问题 In my MDX query I'm using this set of measures in my SELECT statement: With SET [Selected Measures] AS { [Measures].[CTR], [Measures].[Cost], [Measures].[Clicks] } I want in my result to replace the NULL values in '0'. How to do this? 回答1: Is it possible to touch upon the cube design? If so you need the open the cube solution, navigate to the "Calculations" tab and add in the below code. Then deploy the changes. SCOPE([Measures].[CTR]); IF THIS IS NULL THEN this = 0 END IF; END SCOPE; SCOPE(

MDX: avg advanced use

杀马特。学长 韩版系。学妹 提交于 2019-12-24 07:14:09
问题 I am reaching the limit of my basic MDX knowledge on a problem, if anyone has an idea, every help will be welcome Situation This is the hierarchy I'd like to deal with. In my fact_table I have a [Measures].[Sales] measure. [All Management].[TemplateMgt].[CityMgt].[DistricMgt].[StoreMgt] [All Management].[TMP-00.002].[London].[DistricMgt].[Shoe001] [All Management].[TMP-00.002].[London].[DistricMgt].[Hat001] [All Management].[TMP-00.002].[London].[DistricMgt].[Electronic001] [All Management].

Stored procedure in MDX

喜欢而已 提交于 2019-12-24 06:37:49
问题 It is possible to create stored procedure in MDX (Microsoft Analysis Serwer) the same like in MS SQL? I created simply query in MDX and now I would like to use this query to build stored procedure. 回答1: I don't believe there are stored procedures as such. What we use is this project compiled into SQL Server: https://olapextensions.codeplex.com/ 回答2: There is no stored procedure in MDX. 来源: https://stackoverflow.com/questions/39097986/stored-procedure-in-mdx

SSAS MDX Calculate running total but exclude less significant rows

陌路散爱 提交于 2019-12-24 03:19:16
问题 Old SQL developer, new to MDX: Need help with a requirement to include small totals in a running total but not show the contributing rows of those small totals. Consider this data Amount Running Total Denver 6,321 6,321 Portland 8,426 14,747 Boise 19,222 33,969 Helena 23,257 57,226 Bozeman 31,225 88,451 Seattle 36,894 125,345 My requirement is to not show any amounts under 15,000 but instead show the running total that includes them. I must not show amounts or running totals less than 15,000.

Defining a calculated member in MDX - filtering a measure's value

此生再无相见时 提交于 2019-12-24 02:13:07
问题 I need to define a calculated member in MDX (this is SAS OLAP, but I'd appreciate answers from people who work with different OLAP implementations anyway). The new measure's value should be calculated from an existing measure by applying an additional filter condition. I suppose it will be clearer with an example: Existing measure: "Total traffic" Existing dimension: "Direction" ("In" or "Out") I need to create a calculated member "Incoming traffic", which equals "Total traffic" with an