SQL Server 2016 Analysis services error Failed to save modifications to the server. Error returned count of segments is different from partition segments count. Possible cause for this issue is table metadata file corruption
Get first item of dynamic named set
Hello,
I created a dynamic set but I don't know how to access the items within the set.
CREATE DYNAMIC SET CurrentCube.[Dyn_Dates] as [Date].[YearMonth].[Date].Members;
Now I want to pass the first (string)item or member as a parameter to my C# assembly function.
I tried things like:
[Dyn_Dates].item(0), [Dyn_Dates].lag(0), head([Dyn_Dates], 1)
But nothing works, I don't get an valid value.
Add column in existing MDX.
I need to add a column in existing MDX and its values should be 1,1,1,1, and 2,2,2 like below.
Top line income 1
Products (GL)1
Net Interest Income (NII) 1
Non Interest Revenue (NIR) 1
Products ( Non GL) 1
Net Interest Income (NII) 1
Non Interest Revenue (NIR) 1
WIP (No. of Prospects Logged)2
WIP (Prospects Total Amount) Exposure2
WIP (Prospects Total Amount) Deposits2
Accepted Payouts in Progress (volume)2
Accepted Payouts in Progress Exposure2
Approval Rate (%)2
Rejection Rate (Not taken up) (%)2
and so on.
How to achieve this in existing query?
MDX:
WITH
MEMBER [Measures].[Measure_Key] AS [ScoreCardMeasures].[ScoreCard].MEMBER_KEY
MEMBER [Measures].[Measure_Group_Key] AS [ScoreCardMeasures].[ScoreCard].PARENT.MEMBER_KEY
MEMBER [Measures].[Structure_Level] AS [CustomerStructure].[Provincial Structure].LEVEL_NUMBER
SET [ReportLevel]
AS FILTER([Report Levels].[Report Level].[Report Level],
CINT([Report Levels].[Report Level].Properties( "Structure Level" )) = CINT([Measures].[Structure_Level]))
MEMBER [Measures].[Sequence] AS [ScoreCardMeasures].[ScoreCard].Properties( "Sequence" )
MEMBER [Measures].[Indent] AS [ScoreCardMeasures].[ScoreCard].Properties( "Font Indent" )
MEMBER [Measures].[Weight] AS [ScoreCardMeasures].[ScoreCard].Properties( "Font Weight" )
MEMBER [Measures].[Header] AS [ScoreCardMeasures].[ScoreCard].Properties( "Values Header" )
MEMBER [Measures].[Header1Caption] AS [ScoreCardMeasures].[ScoreCard].Properties( "Header Name1" )
MEMBER [Measures].[Header2Caption] AS [ScoreCardMeasures].[ScoreCard].Properties( "Header Name2" )
MEMBER [Measures].[Header3Caption] AS [ScoreCardMeasures].[ScoreCard].Properties( "Header Name3" )
MEMBER [Measures].[Actual] AS [Measures].[Measure Value]
MEMBER [Measures].[Target] AS [Measures].[Measure Target]
MEMBER [Measures].[Average] AS [Measures].[Average Value]
SELECT
{
[Measures].[Measure_Key],
[Measures].[Measure_Group_Key],
[Measures].[Structure_Level],
[Measures].[Sequence],
[Measures].[Indent],
[Measures].[Weight],
[Measures].[Header],
[Measures].[Header1Caption],
[Measures].[Header2Caption],
[Measures].[Header3Caption],
[Measures].[Actual],
[Measures].[Target],
[Measures].[Average]
} ON COLUMNS,
{
FILTER(
[ReportLevel] *
ORDER(
DESCENDANTS(STRTOMEMBER(@Financial_Measure),
[ScoreCardMeasures].[ScoreCard].[Measure Code], LEAVES),
[Measures].[Sequence], ASC),
[Measures].[Active Indicator] <> 0)
} ON ROWS
FROM
[ScoreCard]
WHERE
(STRTOMEMBER(@SiteStructure), STRTOMEMBER(@Time))
pivot table 2010 olap formatting ignore for null value
Dear All,
Please see below a screenshot made with Exel pivottable 2016 (installed onto my computer).
I defined a back_color on a level of my hiererchy. As you can see below, this formatting displays correctly even the value is empty in 2016. I made the same exercise with Excel pivottable 2010 (version installed on the client machine) but it doesn't work. The cell formatting cell displays only if value exists.
Have you an idea? Is it a bug on Excel 2010? For info, the option Fill Color is ticked in both version.
Thankso in advance
An unexpected error occurred (file 'pccoordinator.cpp', line 2052, function 'PCMainCoordinator::Init').
HI Guys,
I have recently upgraded to SQL server 2016 (previously from SQL server 2014) and when trying to Process or deploy any tabular models (previously build in SQL Server 2014) i receive the following error:<o:p></o:p>
An unexpected error occurred (file 'pccoordinator.cpp', line 2052, function 'PCMainCoordinator::Init').<o:p></o:p>
Weird thing is that all models processed and deployed perfectly on the SQL server 2014 instance used prior.<o:p></o:p>
Anyone else having this problem? And if so any solutions?
<o:p>Regards,</o:p>
Query Timeouts
Hey Darren,
I hope you are good.. i am beginner of SSAS, i have same problem what you guys discussed here. but i have found MDX code for nonempty function instead of Filter for measure filter. but what i am looking is that is the same functionality to do in excel or Dundas with connected cube instead of writing MDX query or apply this same condition by creating measure itself. because i am getting time out error if select the data.
my report looks like
month | Location | Grade | Client | Measure Field1 | Measure Field2 |
Jan | 1 | 1 | A | Null | Null |
Jan | 2 | 2 | A | Null | Null |
Jan | 1 | 1 | B | 1 | 1 |
Jan | 2 | 1 | B | 1 | 1 |
so i wanted to ignore the data "Null" for those measure fields in Calculation instead of writing MDX query
Thanks
VinothKumar
PREVIOUSMONTH() always returns "(blank)"
I am unable to get the PREVIOUSMONTH() function to work properly; it always returns blank. As far as I can tell, my syntax is OK, so I must be missing something. Hopefully someone can identify what I'm doing wrong?
Here is an example of three measures I have in a model of the Adventure Works DW using the FactInternetSales table:
Sum of SalesAmount := SUM([SalesAmount])
Sales This Month := TOTALMTD([Sum of SalesAmount],FactInternetSales[ShipDate])
Sales Last Month := CALCULATE([Sum of SalesAmount],PREVIOUSMONTH(FactInternetSales[ShipDate]))
"Sum of SalesAmount" and "Sales This Month" return good values, but "Sales Last Month" always returns "(blank)"
Excel 2013/Windows 7 Showing Incorrect Grand Totals
I have several users on Excel 2013/Windows 7 that are getting incorrect grand totals in SSAS pivot tables. The same exact file calculates correctly on my computer and several other users that are in the same SSAS role as the problem user. It seems as long as they are are using Excel 2010 SP2/Windows 7, everything calculates correctly.
Has anybody else ran into something similar to this? I've been developing in SSAS/Excel for 9 years straight and I am stumped.
'' Hexadecimal value 0x01, is an invalid character, Line 1...
Recently we encountered below error while browsing a cube in SSAS but while accessing the same dimension in Excel we did not see the error. We did a workaround to remove all those special character but is this expected. Similar issue is seen in the PowerBI layout as well.
passing parameter to link to other report
hi, below <g class="gr_ gr_43 gr-alert gr_spell gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="43" id="43">ssas</g> data set which populates a chart and wants to pass a parameter Year to link to another chart in ssrs so what I have to change. anyone can help, please.
this is the code for the first chart:
SELECT NON EMPTY { [Measures].[Fact Loan Behaviour Count] } ON COLUMNS, NON EMPTY { ([Dim Time].[Year].[Year].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM [Loan Behaviour Data Warehouse] CELL PROPERTIES VALUE, BACK_COLOR,
FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
this is the code for the first chart:
SELECT NON EMPTY { [Measures].[Fact Loan Behaviour Count] } ON COLUMNS, NON EMPTY { ([Dim Time].[Year].[Year].ALLMEMBERS * [Dim Custormer Information].[Education].[Education].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM ( SELECT ( STRTOSET(@DimTimeYear, CONSTRAINED) ) ON COLUMNS FROM [Loan Behaviour Data Warehouse]) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS SELECT NON EMPTY { [Measures].[Fact Loan Behaviour Count] } ON COLUMNS, NON EMPTY { ([Dim Time].[Year].[Year].ALLMEMBERS * [Dim Custormer Information].[Education].[Education].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM ( SELECT ( STRTOSET(@DimTimeYear, CONSTRAINED) ) ON COLUMNS FROM [Loan Behaviour Data Warehouse]) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
how to get the last value using calculated measure
Hi,
I have a cube and a date dim. I have a measure group and a measure value.
I wasn't to get the value of the last non empty value when a user selects a date range.
if the user selects any hierarchy from the date dim, then the last value of that date range need to be visible. it should not aggregate the values. so, when the user selects Month or Week, the value should be the last value of that Month or Week.
I am trying to use the TAIL function in calculated measure but its not working. is there a way to do this..?
any help would be really helpful...
Anirban Biswas (v-anbis@microsoft.com)
XMLA Batch Transaction=false still throw error and cause another process stop
I have 3 dimensions, dimension 1 -> error, dimension 2&3 -> ok
Why my XMLA still throw error even I set Transaction to false?
Currently I'm running SSAS 2016.
Code:
<Batch xmlns='http://schemas.microsoft.com/analysisservices/2003/engine' Transaction='false'>
<Process xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Type>ProcessFull</Type>
<Object>
<DatabaseID>Testing XMLA</DatabaseID>
<DimensionID>CSV_GENERAL_FLAG_c9df5b43-2eca-42ef-9a3e-9398a4f702cd</DimensionID>
</Object>
</Process>
<Process xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Type>ProcessFull</Type>
<Object>
<DatabaseID>Testing XMLA</DatabaseID>
<DimensionID>RSL_GENERAL_FLAG_6e7cfce8-bb66-4650-89af-a9f17164f8d3</DimensionID>
</Object>
</Process>
<Process xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Type>ProcessFull</Type>
<Object>
<DatabaseID>Testing XMLA</DatabaseID>
<DimensionID>SALES_GENERAL_FLAG_3e2fdcb1-731f-44f9-a56f-2c1718457c01</DimensionID>
</Object>
</Process>
</Batch>
Result:
<return xmlns="urn:schemas-microsoft-com:xml-analysis"><results xmlns="http://schemas.microsoft.com/analysisservices/2003/xmla-multipleresults">
<root xmlns="urn:schemas-microsoft-com:xml-analysis:empty">
<Exception xmlns="urn:schemas-microsoft-com:xml-analysis:exception" />
<Messages xmlns="urn:schemas-microsoft-com:xml-analysis:exception">
<Error ErrorCode="3241541694" Description="Column 'CSV_GENERAL_FLAG' in Table 'CSV_GENERAL_FLAG' contains a duplicate value '1' and this is not allowed for columns on the one side of a many-to-one relationship or for columns that are used as the primary key of a table." Source="Microsoft SQL Server 2016 Analysis Services" HelpFile="" />
<Error ErrorCode="3239837702" Description="The current operation was cancelled because another operation in the transaction failed." Source="Microsoft SQL Server 2016 Analysis Services" HelpFile="" />
</Messages>
</root>
<root xmlns="urn:schemas-microsoft-com:xml-analysis:empty">
<Exception xmlns="urn:schemas-microsoft-com:xml-analysis:exception" />
<Messages xmlns="urn:schemas-microsoft-com:xml-analysis:exception">
<Error ErrorCode="3239837702" Description="The current operation was cancelled because another operation in the transaction failed." Source="Microsoft SQL Server 2016 Analysis Services" HelpFile="" />
</Messages>
</root>
<root xmlns="urn:schemas-microsoft-com:xml-analysis:empty">
<Exception xmlns="urn:schemas-microsoft-com:xml-analysis:exception" />
<Messages xmlns="urn:schemas-microsoft-com:xml-analysis:exception">
<Error ErrorCode="3239837702" Description="The current operation was cancelled because another operation in the transaction failed." Source="Microsoft SQL Server 2016 Analysis Services" HelpFile="" />
</Messages>
</root>
</results>
</return>
Totals issue when multi select on dimension or dimension hierarchy
Hi,
MDX is not bringing the correct totals when both dimension and its hierarchies are sharing the common level. Here is the one example with Adventure works with customer dimension. AggregatedMember is not considering the slicer expression with its hierarchy to filter the data.
WITH
MEMBER [Customer].[Customer Geography].[AggregatedMember] AS
'Aggregate({[Customer].[Customer Geography].[State-Province].&[FL]&[US],[Customer].[Customer Geography].[State-Province].&[TX]&[US],[Customer].[Customer Geography].[State-Province].&[WA]&[US],[Customer].[Customer Geography].[State-Province].&[BC]&[CA]})'
SET [Provinces] AS
'{[Customer].[Customer Geography].[State-Province].&[FL]&[US],[Customer].[Customer Geography].[State-Province].&[TX]&[US],[Customer].[Customer Geography].[State-Province].&[WA]&[US],[Customer].[Customer Geography].[State-Province].&[BC]&[CA]}'
SELECT
{ [Measures].[Customer Count] } ON COLUMNS,
NON EMPTY Union ( {[Customer].[Customer Geography].[AggregatedMember]}, Hierarchize ( { [Provinces] } ) ) ON ROWS
FROM [Adventure Works]
WHERE ( [Customer].[Customer].&[15566])
Actual Result:
Customer Count | |
AggregatedMember | 3,829 |
British Columbia | 1 |
Expected Result:
Customer Count | |
AggregatedMember | 1 |
British Columbia | 1 |
Please provide your insights on this.
Thank you,
Rajasekhar
SSAS Dimension Attribute To be Displayed in an another Dimension
Hello Team,
Good Morning. I do have a question regarding the Dimension attributes Folder Display. For an example, do have two dimensions Customer & Product
For Customer Dimension, do have Customer Name & Customer Address.
For Product, do have the Product Name & Product Price.
The FACT data existed in the table is having different surrogate keys for both the dimensions. But, In the cube level we are expecting see the Customer attributes also under Product Dimension itself. (Likewise the way how we will be hide the metrics and show under an another measure group using Display Folder).
Is there any chance for having this kind of implementation possible?
Please do provide your inputs on the same.
Thank you.
Regards,
Pradeep.
Limiting measures in SSAS cube
Hi guys,
I am trying to limit certain fields in the cube to only show values to certain roles.
when I enter the MDX:
( Measures.CurrentMembers IS [Measures].[Hours Captured By Month])
Only this measure returns a result which is correct. all other measures default to (null)
But when I try extend the measures available to the role with
( Measures.CurrentMembers IS [Measures].[Hours Captured By Month])
AND ( Measures.CurrentMembers IS [Measures].[Actual Hours Captured By Month])
all measure return a (null)
any idea why?
Error in Pivot chart drill down: The attribute in the dimension is outisde the granularity of measure group
Hi Experts,
I created drill down on Distinct count of user in measure. When drill down it throws error like "The attribute in the dimension is outisde the granularity of measure group".
I don't know what is wrong.Kindly guide me.
Thanks
Errors in the high-level relational engine. A connection could not be made to the data source with the DataSourceID of '
When I deploy the cube which is sitting on my PC (local) the following 4 errors come up:
Error 1 The datasource , 'AdventureWorksDW', contains an ImpersonationMode that that is not supported for processing operations. 0 0
Error 2 Errors in the high-level relational engine. A connection could not be made to the data source with the DataSourceID of 'Adventure Works DW', Name of 'AdventureWorksDW'. 0 0
Error 3 Errors in the OLAP storage engine: An error occurred while the dimension, with the ID of 'Customer', Name of 'Customer' was being processed. 0 0
Error 4 Errors in the OLAP storage engine: An error occurred while the 'Customer Alternate Key' attribute of the 'Customer' dimension from the 'Analysis Services Tutorial' database was being processed. 0 0
Tabular model - Force multi select
Hi,
I have designed a Tabular model solution to represent transactions that have occurred in the company (invoices paid in, expenses paid out). There are a number of other related transactions (VAT, Corp. Tax) etc. but the main transactions are income (Invoices) and business expenses (Expenses)... everything else is derived from these two.
This part is working fine (central FactTransactions table connected to DimInvoices) and a bunch of measures.
I would now like to do some WhatIf analysis, testing the impact of "future invoices" that might occur, such as for as example, future work that I might do, which will result in more income (but also associated corp. tax). To make this visually simpler, I have added sample entries of "WhatIf Invoices" to the DimInvoices and Fact table.
However, the "WhatIf" income will always be in addition to the "Real" income. I added a slicer to my Pivot Table report, based on InvoiceType and InvoiceAmount. The idea was that, I will select 'Real' and 'WhatIf' in a multi-select filter and then select the required 'WhatIf' amount in a slicer. So that, the real amounts will be picked up and in addition the invoice corresponding the selected 'WhatIf' amount. But what happens is that, in order to make the above work, I always need to select '0' in the Invoice/WhatIf Invoice table, to make sure that real transactions get picked up. Is there any way to get around this?
I also tried putting the "WhatIf" amounts in a separate dimension.
I have attached a portion of my design here... Let me know if this design is flawed or I'm missing something or if you need more info.
Thanks,
Shri
- Please mark the answer as correct if it answered your question. Thanks!
Segmentation using two measures
Hi,
Background: I am building an SSAS Tabular solution for keeping track of my small company's finances.
For this I have a central Fact table consisting of transactions that have occurred (Payments made to my company by clients, expenses, VAT paid, Salary paid (to myself), Dividends drawn etc.), a Date dimension and a few other supporting "Dimensions" (though I realize in Tabular there is not a clear distinction between Fact and Dim tables).
For the key items, such as [Gross Revenue], [Corporation Tax] due, [Net Profit], I have created a few Measures, since these are cumulative during the company year. These are working fine
Objective: The way it works for my setup in the UK (where I operate), is that after all company tax payments are made, I can draw Dividends equal to [Net Profit] during the company year. However, depending on the "Financial Year" (which ends on Apr 5), the total amount I draw (which band) during the FY will determine, how much of it will be withheld as taxes.
I am trying to achieve a PivotTable to analyze such that, I can view the Net Dividend (= Total Dividend (same as Net Profit for this case) - [Tax withheld]; broken down by the Date dimension.
To work this, I created a separate dimension called Dim_DividendThresholds which contains the Fin. Year, the various bands and their associated tax. percent, while starting to follow this pattern... Dynamic Segmentation
Question: I now have two questions, one whether this will work, since I am essentially trying to segment the [Net Profit] based on the date (which will determine the Fin. Year) as well as the [Net Profit] amount itself, a combination of which will determine the tax percent.
Here are a few things that might help
The measures that I have created so far (simplified)
Gross Revenue:=SUMX(Fact_Transactions, IF([transactionType] = "Income", [total], 0)) Expenses:=SUMX(Fact_Transactions, IF([transactionType]="Expense" || [transactionType] = "Other Expense", [total], 0))*-1 Operating Profit:=[Gross Revenue]-[Expenses] CT:=[Operating Profit]*0.2 Net Profit:=[Operating Profit]-[CT]
The Dividend Dimension looks like this...
Happy to provide more info. if needed. Any assistance would be much appreciated.
Thanks,
Shri
- Please mark the answer as correct if it answered your question. Thanks!
Can't display Partition Property "Source" in Management Studio
Hello,
After upgrading my SSMS to 13.0.15700.28 I'm unable to display the source property of an SSAS cube partition (when clicking the button to the right of the property value). I'm currently using SSAS 2012.
When I try to do so, I get an error saying "Object reference not set to an instance of an object".
Is this no longer supported?
Thanks,