Quantcast
Channel: SQL Server Analysis Services forum
Viewing all 14337 articles
Browse latest View live

Need help with logic

$
0
0

Hi All ,

I need help with measures. I have  two fact tables in a cube . I need to create a calculation based of a measure (count). The calculation is as follows sum(rev)/#ofdaysinperiodwhere WRAP>0*44.5/sum(principal)/#fdaysinperiodwhere WRAP>0.

WRAP is a boolean value 0 and 1. So i wanted to create a measure on WRAP, but i want only the count when it is >0 which is 1. Is that possible? Please advice.

Thanks


Internal Error in UBO dialog

$
0
0

the Aggregation Design Wizard is returning the following error when clicking Start in theSet Aggregation Options page:

Internal error: An unexpected error occurred (file 'pcminorobjcoll.inl', line 377, function 'PCMinorObjectCollection<class PCDetailProperty,class NoNameHashSupport>::GetAt').

To restart the process, resolve the problem, and then click Start.How can I resolve this problem?


SSAS - hierarchy with non unique data

$
0
0

Cleaning the data via ETL is not an option at this point since I've been asked to produce a quick POC.

I have the following fields in a dimension.

Type   SubType   Category Product  ProductKey                        Hierarchy 1            Hierarchy 2

A           a               a          p            1                                       Type                     SubType

A           a               a          p            2                                       SubType               Category

A           a               a          p            3                                       Category             Product

B           b               b          t             4                                                      

When processing it fails due to duplicate key.  The only way to make it work is if I set theKeyColumn value (in the DimensionAttribute properties) to be the ProductKey for attributes Category and Product. 

Will this cause incorrect aggregations?  If so, what would you recommend?  Thanks


ml

Invalid Aggregation when counting objects

$
0
0

The UBO dialog is returning "ERROR:  invalid aggregation" in the Specify Object Counts dialog after clicking "Count".  But there are no aggregations. All existing aggregations have been deleted.  How can I identify the source of this error and fix it?

SSAS 2017 running on 2016 Server




SSAS Multidimensional - Browsing Hierarchy Loses Level Total

$
0
0

When browsing the data hierarchy, I lose the level totals as I drill into the hierarchy.  What setting controls this behavior?



MDX Query Results Order By Date

$
0
0

I am having trouble getting this MDX query to consistently order the results by 1 Date field. 

The query always results in 2 rows. A data set example with the important columns looks like this. 

DateLastInvoiceDateMonthEndLabel
10/19/2018  Last Invoice Date - 10/19/2018
10/5/2018  Last Month End - 10/5/2018

I need the results to always sort by the Date field with the most recent date first. Currently the code below sorts it this way, but the problem is, sometimes the data set will randomly order differently (it breaks a report). 

You can see I have an order by on that date field (bolded below) but it is not working. If I change it from ASC to DESC, it doesn't change the order, so I know it's not working. How do I order by the date field?

WITH 
  MEMBER [Measures].[LastInvoiceDateMonthEnd] AS 
    IIF( 
      [Invoice Date].[Relative Date].currentmember.member_caption = "Last Invoice Date", "Last Invoice Date", 
      [Invoice Date].[FiscalMonthLastDay].currentmember.member_caption 
    ) 
  MEMBER [Measures].[LastInvoiceDateMonthEndLabel] AS 
    IIF( 
      [Invoice Date].[Relative Date].currentmember.member_caption = "Last Invoice Date", "Last Invoice Date - "+[Invoice Date].[Date].currentmember.member_caption, "Last Month End - "+[Invoice Date].[Date].currentmember.member_caption 
    ) 
SELECT 
  NON EMPTY { 
    [Measures].[LastInvoiceDateMonthEnd], 
    [Measures].[LastInvoiceDateMonthEndLabel] 
  } ON COLUMNS, 
  NON EMPTY { 
    ( 
      [Invoice Date].[Fiscal Days In].[Fiscal Days In].allmembers *Order([Invoice Date].[Date].[Date].allmembers, 
	   [Invoice Date].[Date].currentmember.member_name, ASC) *
      [Invoice Date].[FiscalMonthLastDay].[FiscalMonthLastDay].allmembers * 
      [Invoice Date].[Relative Date].[Relative Date].allmembers 
    ) 
  } DIMENSION PROPERTIES member_caption, member_value, member_unique_name ON 
  ROWS 
FROM ( SELECT 
       ( 
         { 
           [Invoice Date].[Relative Fiscal Month Offset].&[-1], 
           [Invoice Date].[Relative Fiscal Month Offset].&[0] 
         } 
       ) ON COLUMNS 
     FROM [Model]) 
WHERE ( 
        [Invoice Date].[Relative Fiscal Month Offset].currentmember, 
        [Invoice Date].[LastInvoiceDateMonthEnd].&[Yes] 
      ) CELL PROPERTIES value, back_color, fore_color, formatted_value, 
format_string, font_name, font_size, font_flags

Unwanted measure group in Olap Excel

$
0
0

Dear all,

recently, a new and unwanted measure group appears when browsing one of our multidimensional cube (SQL Server 2016) in Excel. It appears after each and every measure group :

[Sigma] Measure group name 1

[Sigma] Unwanted measure group name

I checked in our SSAS project that:

-each calculated measure is associated to a measure group

-each measure group is related to at least one dimension

Where else should I look at ?

Many thanks in advance,

Drillthrough Action Not Working for Some Users

$
0
0

I have a drillthrough action that works fine for IT personnel who have elevated permissions but not for other users. What is happening is when the user right clicks in Excel and selects "Additional Actions" and then clicks on the action name, it does perform the drill-through but does not show values, only the ID values.

From what I have been able to gather, this is a permission issue that needs to be set on the action itself but I have been unable to do that. If anyone can offer me any assistance, I'd appreciate it. Thanks.


Tabular DMV DISCOVER_CALC_DEPENDENCY isn't compatible with SUMMARIZE ?

$
0
0

When using SUMMARIZE in a measure's DAX expression, the resulting cube can't be object of DISCOVER_CALC_DEPENDENCY query.

Bug or 'feature' ?


Please help why the result is null for MDX query ?

$
0
0

WITH
      MEMBER[Pre 3 Month]            AS          Format(DateAdd("M",-3,Now()), "MMM-yyyy")  
      MEMBER [Measures].[Cout1]   AS         Sum({[Measures].[Ave Cnt - M]} * {[Date].[Month Year].&[Jul-2018]})    
      MEMBER [Measures].[Cout2]   AS         Sum({[Measures].[Ave Cnt - M]} * {[Date].[Month Year].&[Pre 3 Month]})
      MEMBER [Measures].[Cout3]   AS         Sum({[Measures].[Ave Cnt - M]} * {[Date].[Month Year].&[Format(DateAdd("M",- 3,Now()), "MMM-yyyy")] })

SELECT
     {[Measures].[Pre 3 Month], [Measures].[Cout1],[Measures].[Cout2],[Measures].[Cout3]} ON 0
FROM [Cube]

Results:

[Pre 3 Month]  [Cout1]   [Cout2]   [Cout3]
    Jul-2018        7865      (null)      (null)

               

SSAS tabular model project

Creating a slicer/combo box in Excel ribbon using MDX

$
0
0

Hi, 

We have built a excel report (pivot table) using SSAS cube. Everything works fine and we can slice data using standard slicer or filter for pivot table. However, there is request from user to create a particular menu in excel ribbon to perform following for report:

- select a value from combo boxes 

- apply those value as filters to pivot table

I have searched online and there are various ways to create combo boxes and list of values. However, there is no particular solution to achieve it. Based on my readings, I have few questions:

- I can load the list of values from SSAS cube to excel cell range. Later, use that range to populate combo box. But, how do I send selected value as filter to pivot table

- Can I load the list of values using MDX query directly into combo box?

- If above is possible then how do I use MDX query or cube function to send filters to pivot table?

Any help would be really appreciated.

Regards

Angad


How to replicate MDX Sum function behavior in DAX

$
0
0

Hi,

I am trying to write an equivalent DAX expression for a MDX query as mentioned below-

The MDX query goes like -

I already have a calculated measure with name Measure1 and I am trying to calculate another measure(supposeMeasure2) using Measure1

Create Member CurrentCube.[Measures].[Measure2] as 
   Sum([DimensionX].[X1].[X1],iif([Measures].[Measure1] > 100,1,null))

How to replicate the same in DAX?

I have tried multiple methods like COUNTROWS function to get the no of rows at least, but even the basic result is not generating as expected.

Any help in this regard will be greatly appreciated.

Thanks in advance,

Abhi8
 


Cobe structure does not refresh in Excel.

$
0
0

Yesterday I mad a change to the structure of a cube. I added a column to a dimension. I deployed and processed the cube and when I browse the cube in SSAS, I can see the column in the dimension. But, when I go to Excel, and use the existing connection I have to the cube, I don;t see the column. Even after clicking "Refresh All", the column is not visible. I can solve it for my self by making a new connection to the cube. But that should not be the way for the users of the Cube. 

How to solve this?

SSAS 2014, Excel 2016

Get the Previous time period sales for top 10 products in the current year

$
0
0

Hi,

I have been working on a scenario lately where we need to get the top 10 products for the current year based on sales value.Adding to it if we add state attribute to our query, it should return TOP 10 products in each region based on sales value

Till this step, it was a breeze, I have created a measure(since we need the Top 10 to be dynamic) which get the top 10 products from my product dimension based on total sales.

It is working flawlessly until and unless I had a requirement of adding a PTP measure(measure2) for those top 10 retailers which is returned by initial measure and due to second measure being added the initial row context from measure1 is getting changed and giving me unintended results.

Is there any way to handle the same in model?

Also we have to group the products other than Top 10 as "Others" and show the Total Sales and Totals Sales PTP for them

Example- 

Measure1 Formula : CALCULATE( Total Sales, TOPN(10, ALL(PRODUCT),TOTALS SALES,0),VALUES('PRODUCT'PRODUCT NAME))


Result expected

[Top 10 Product Name]   [Total Sales]  [Total Sales PTP]

1                                     100              200

2                                      200              100

....................................

[Region] [Top 10 Product Name]   [Total Sales]  [Total Sales PTP]

 R1                      1                                     100             200

 R1                     2                                      200             100

............

 R8                     1                                     400             800

 R8                     2                                      400             500

Let me know if any additional info is required?

Thanks in Advance                

AVG X years for specific month in MDX calculation

$
0
0

Hi!

I am very new to OLAP and MDX, so please bear with me if the problem is simple.


I have created a cube with two different fact views so the measures are kept in a actual and a budget folder in the cube.

Now I want to make a calculation which gives me rolling X years in specific month month  , so if the user is standing in Year=2018 and Month = August then

i have to get Avg Sale in 

Year=2015 and month =August ,

Year=2016 and month =August

Year=2017 and month =August

Than sum AVG sale result from above.

My question is: how should the function look like?

Thank you very much.

How to replicate MDX dynamic Named Set behavior in DAX

$
0
0

How to replicate MDX dynamic Named Set behavior in DAX ?

I have a scenario where all products which are not in top 10 should be marked as 'Other' as represent as 11th row.

SSAS Dimension Usage (Measure Group and Cube Dimensions) Relationship Types and Implementation? Many-to-Many Relationship Question?

$
0
0

SSAS Dimension Usage (Measure Group and Cube Dimensions) Relationship Types

Hi All,

I was working on to extract Measure Group and Cube Dimensions Relationship Types metadata and got confused about Many-to-Many Relationship type implementation.

My Question is on Many-to-Many Dimensions: Can we have more than one Intermediate Regular Dimensions linked to Intermediate Fact Table and Fact Table?

1st will mention available Relationship Types and their description:

  1. No Relationship: The dimension and measure group are not related.

      

  1. Regular: The dimension table key column is joined directly to the fact table. A regular dimension relationship between a cube dimension and a measure group exists when the key column for the dimension is joined directly to the fact table. This direct relationship is based on a primary key–foreign key relationship in the underlying relational database, but might also be based on a logical relationship that is defined in the data source view. A regular dimension relationship represents the relationship between dimension tables and a fact table in a traditional star schema design.

      

  1. Fact/Degenerate: The dimension table is the fact table.Fact dimensions, frequently referred to as degenerate dimensions, are standard dimensions that are constructed from attribute columns in fact tables instead of from attribute columns in dimension tables. Useful dimensional data is sometimes stored in a fact table to reduce duplication.

  1.  Referenced: The dimension table is joined to an intermediate Regular dimension table, which is turn, is joined to the fact table. A reference dimension relationship between a cube dimension and a measure group exists when the key column for the dimension is joined indirectly to the fact table through a key in another dimension table, as shown in the following illustration.
          
 

A reference dimension relationship represents the relationship between dimension tables and a fact table in a snowflake schema design. When dimension tables are connected in a snowflake schema, you can define a single dimension using columns from multiple tables, or you can define separate dimensions based on the separate dimension tables and then define a link between them using the reference dimension relationship setting. The following figure shows one fact table named InternetSales, and two dimension tables called Customer and Geography, in a snowflake schema.


You can create a dimension with the Customer table as the dimension main table and the Geography table included as a related table. A regular relationship is then defined between the dimension and the InternetSales measure group.

Alternatively, you can create two dimensions related to the InternetSales measure group: a dimension based on the Customer table, and a dimension based on the Geography table. You can then relate the Geography dimension to the InternetSales measure group using a reference dimension relationship using the Customer dimension. In this case, when the facts in the InternetSales measure group are dimensioned by the Geography dimension, the facts are dimensioned by customer and by geography. If the cube contained a second measure group named Reseller Sales, you would be unable to dimension the facts in the Reseller Sales measure group by Geography because no relationship would exist between Reseller Sales and Geography.

There is no limit to the number of reference dimensions that can be chained together, as shown in the following illustration.


  1. Many-to-Many: The dimension table is joined to an intermediate fact table. The intermediate fact table is joined, in turn, to an intermediate regular dimension table to which the fact table is joined.

Example: I have to create a many to many relationship between Fact Table A and Dimension Table D. Let’s assume I have an intermediate Fact Table called C and Intermediate Regular Dimension Table B.

Intermediate Fact Table C is already having a regular relationship to Dimension D and Intermediate Dimension B. Also Fact Table A already has an regular relationship to intermediate Dimension table B. So Now Fact A and Dimension D have Many-to-Manu relationship.

In most dimensions, each fact joins to one and only one dimension member, and a single dimension member can be associated with multiple facts. In relational database terminology, this is referred to as a one-to-many relationship. However, it is frequently useful to join a single fact to multiple dimension members. For example, a bank customer might have multiple accounts (checking, saving, credit card, and investment accounts), and an account can also have joint or multiple owners. The Customer dimension constructed from such relationships would then have multiple members that relate to a single account transaction.



Note

To support a many-to-many dimension relationship, the data source view must have established a foreign key relationship between all the tables involved, as shown in the previous diagram. Otherwise, you will be unable to select the correct intermediate measure group when establishing the relationship in the Dimension Usage tab of Dimension Designer.

  1. Data Mining: The Target dimension is based on a mining model built from the source dimension. The source dimension must also be included in the cube.


https://docs.microsoft.com/en-us/sql/analysis-services/multidimensional-models-olap-logical-cube-objects/dimension-relationships?view=sql-server-2017



Drop and Create role in Analysis Services Tabular with C#

$
0
0

Hello,

   I have an Analysis Services Tabular compatibility 1200 (dll : Microsoft.AnalysisServices.Tabular). Can u help me to know how i can add and drop role please?.

For Now I can drope a member of a role but not the role. I try to use the function ModelPermission without sucess.

Can someone help me pease.

Regards


Reponse

Wild Card Serach in MDX whiel querying cube

$
0
0

Dear All,

 I want to put the user search function in  parameter section where our UI is connencted to SSAS cube. This couls be wildcard search as well.  I am aware that we can  search for a substring in a MDX query. But do we have an option to search for individual characters like the once we perform in SQL queries?

For example if my product names are :  MMA11, MMB21,MMC11, MMD51 and if my users want to search all of them with single input parameters like MM??1 where '??' are wild card replacement for single characters. This will give me all the products with the names 'MMxx1' without any other products with extra characters.

Is this is possible to make?

Thanks in advance,

Viewing all 14337 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>