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

ISEMPTY Syntax in DAX

$
0
0

My DAX query was taking a long time to run when I added NOT ISBLANK() condition in CALCULATE statement. After researching for workaround, I found an article that suggested replacing ISBLANK() with ISEMPTY() function in the new SP of SQL Server. I did that but when I run my below DAX query now, I am getting error message "The ISEMPTY function expects a table expression for argument '1', but a string or numeric expression was used."

What am I doing wrong? What is the correct ISEMPTY() syntax?

evaluate
 filter
 (
  addcolumns
  (
   summarize
   (
    'ET'
    'P'[Name]
   )
   "Column1", calculate (distinctcount('ET'[C_ID]), 'ET'[S_FLAG] = 1, NOT ISEMPTY ('ET'[C_ID]))
  ),
  'A'[ID]=289  
 )


Equivalent of TSQL's IF EXISTS in DAX

$
0
0

I am looking for DAX's equivalent for TSQL's IF EXISTS.

Here is my table:

NameFlag
Emily5
Victoria5
Kimberly5
John4
Joe5
Sam5
Emily4
Victoria4
Sam4
Emily4
Victoria5

and here is my TSQL query:
select count (distinct (name))
from table1 t1
where
  flag = 5
  and exists (select * from table1 t2 where t1.name=t2.name and flag=4)

It should return 3 (Emily, Victoria and Sam).

Basically, I am looking for count distinct name for rows that have flag=5 and at least have one flag=4 for the same person. Maybe it can also be described as union between two tables table1 for flag=5 and table2 for flag=4.

Can we do this in DAX?

Thanks

 

Errors in the back-end database access module. The size specified for a binding was too small, resulting in one or more column values being truncated.

$
0
0

I have created a calculated member Month from time dimension. this appears as one of the attributes of time dimension in the cube, besides year and quarter. the attribute types in the dimension are month, quarter and year, duly checked. However, when I try to deploy the cube, it throws an error message:

End database access module. The size specified for a binding was too small, resulting in one or more column values being truncated.  

Errors in the OLAP storage engine: An error occurred while the 'Month' attribute of the 'DimTime' dimension from the 'ManufacturingDM' database was being processed. 

Please suggest how do I resolve this, at the earliest.

MDX Code - Performance for Calculated Measure

$
0
0

Hi

I've very little experience of using MDX but i was provided with the below code to create a calculated OLAP measure that appears to be the reason the performance of my report is so poor. I'm hoping someone can help me write something alot more effiecently?

sum(tail(nonemptycrossjoin(Descendants([Reporting Date Hierarchies].[YWD].currentmember,[Reporting Date Hierarchies].[YWD].[rep_dt_1])),1),[Measures].[outstandSUM])

The code essentially looks at daily data and in my report i have time hierachy YWD in rows and Months (non time hierachy dimension) in coloumns, it is a business requirement to provide the report as such. When looking at this initial level the yearly figures represent end of month position for given year, at week level end of week positions for monthly and yearly.

Could someome suggest alternative and more performance friendly code?

Thanks in advance

Visual Studio OLAP Cube Partition issues.

$
0
0
I'm trying to create new partitions in my OLAP cube in Visual Studio 2012. The partition wizard appears and I go through all the steps. When I click finish, nothing happens. No error message and no partition is created. Is this a possible bug in the application. I'm updated fully. It just doesn't create the partition. I can create it in SSMS but not in VS2012. Any help would be appreciated.

First Time Working with SSAS

$
0
0

I'm reading a couple books on SSAS and trying to build a simple cube.  I'm using Adventure Works, and I can load a data source but whenever I try to load a data source view, I always get this error.

Absolutely nothing works.  What am I doing wrong here?

Thanks.


Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

How to calculate comparison among specified data range using MDX

$
0
0

hi there:

 I've created a calendar [year -month - day] hierarchy and created mdx calculated member on measure.

(([Checkoutdate].[Year-Month-Day].currentmember,[Measures].[Item Total])- (ParallelPeriod([Checkoutdate].[Year-Month-Day].[Year],1,[Checkoutdate].[Year-Month-Day].currentmember),[Measures].[Item Total]))

So far, it works fine when people   drag  [year -month -day ] into column via excel. 

When they drag this hierarchy into Excel report filter area and start to specify dates, MDX calculated member seems not function well. 

Is there any way to find out the difference between specified date range using calculated member? 

 Thanks

 Hui


--Currently using Reporting Service 2000; Visual Studio .NET 2003; Visual Source Safe SSIS 2008 SSAS 2008, SVN --

A particular attribute shown in all queries

$
0
0

I was given a SSAS test and the question goes like this

Developer notices a cube in production, that one particular attribute is used in every user query. How does he fix it?

Answer Options:

a.) Create an unnatural hierarchy and include the attribute.

b.) Create a natural hierarchy and include the attribute.

C.) Set processing mode to Lazy aggregations

d.) Aggregation usage to full in cube design dimension section.

I think the answer is between a and b. But i don't have the explanation. Could you please explain. Thanks in advance.


svk


Correct way to move Cube storage

$
0
0
I want to move the data for only one of my cubes to a different drive. With SSMS I connected to Analysis Server, went to the server properties, and updated AllowedBrowsingFolders to include the new drive. I then went to my cube, right clicked on it, and went to properties. Under storage location I was then able to choose the new drive. I saved that and re-processed the cube however the data is still in the old location. What is the proper method to move the data for only one cube?

SSRS report with cube – MDX query how to get an extra row with value '0'.

$
0
0

Hello everyone,

I'm unable to write the MDX query to get '0' value as first row in output. Following is my MDX query:

WITH MEMBER [Measures].[Dummy] AS   '0'
SELECT NON EMPTY Union( {[Measures].[Amount] },{[Measures].[Dummy]}) ON COLUMNS,
NON EMPTY  { ([Customer].[Customer Nbr].[Customer Nbr].ALLMEMBERS * [Fiscal].[Year].[Year].ALLMEMBERS ) }
having  [Measures].[Amount] > 5000
ON ROWS FROM [cube]

With above query, the output returns the value '0' as a separate column.

I would like to get it in form of first row for [Measures].[Amount]. Like,

Amount

0

500

200

100

What needs to be changed to achieve the above result? I'm planning to use the above value in line chart to start the line from 0th value as described in following URL. (Note: The below URL is using SQL query and not MDX expressions.)

http://spinerain.blogspot.in/2013/09/ssrs-line-chart-create-stacked-line-and.html


Thanks, Ankit Shah


Inkey Solutions, India.
Microsoft Certified Business Management Solutions Professionals
http://www.inkeysolutions.com/MicrosoftDynamicsCRM.html

SSAS- DAX expression : Is there any DAX function that can return multiple values ?

$
0
0

Hi,

Iam in search of a DAX function that can return multiple values as result. please find below scenario where i want to implement the same.

I have three  Tables: Table A (typeid, Cost, Qty ) ,Table B (typeid, Cost, Qty ) , Table C ( typeid,Typename ) .

Table A                                       Table B                                Table C

type id  cost  Qty             type id   Cost    Qty                  typeid  typename

1           100    100                3         300      300                  1           aa

2           200    200                4          400     400                  2           bb

                                                                                         3           cc

                                                                                         4           dd 

i have to club cost and Qty of two tables(four measures)  as two measures in the  UI report. There are more columns in these tables that restrict the  UNION of the tables.(for the sake of understanding , i have not mentioned the othr columns). In the UI report(Execl 2013-power pivot) iam plotting these measures against theTable C.Typeid. Hence the measures drill down against each Table C. Typeid as shown below:

Typeid  Table A.cost  Table A.Qty  TableB.cost  TableB.Qty                              

1              100             100

2              200             200

3                                                     300             300      

4                                                     400             400

My requirement is to club these measures so that the report will be as below

Type id  cost   Qty

1          100    100

2          200    200

3         300     300

4         400      400

Since i cannot club these in model,as a work around, i created a calculated measure in excel(Analyze tab->Calculations->olap tools->calculated measure) with the condition as below:

new cost = IIF (ISEMPTY(TableA.cost)="TRUE",TableB.cost,TableA.cost)

new Qty = IIF(ISEMPTY(TableA.Qty)="TRUE",TableB.Qty,TableA.Qty) and dragged these new measures into the report. It was working fine as expected.

But  this functionality of Creating calculatedmeasure in excel report is possible only in 2013 excel version.

Now the requirement is to get the same result in 2010 excel. Can you please help me in implementing the same in 2010 excel? or any other alternative method to bring the columns in model itself. I tried to create a measure in table A with DAX expression as : new cost :=CALCULATE(SUM(Table B.cost),ISBLANK(TableA.cost)) -> but this will return only 1 result .i need Sum(Table A.cost) also if it is not blank.

Thanks in advance








Offline cube doesnot support Distinct Count

$
0
0

Hi All,

I was trying to create an Offline Cube thru Excel. but it is not allowing me to use DistinctCount() MDX. It is giving the following error

then I tried this with CREATE GLOBAL CUBE Command, there I can not even  use Calculated Measures.

Does that mean we can not use Distinct Count function with Offline Cubes?


Distinct Count Measure on Dimension table via Bridge table.

$
0
0

Hi Team,

I have Dim_Devices Table, which is linked to other dimension like Dim_User  and Dim_City.

All these table has many to many relationship defined in bridge table i.e. B_Devices_User_City using referential keys.

I want to derive measure such as

Select Count(Dim_Devices[Device_Id])

where Dim_Devices.Validity_End_Date is null

Note : Device_Id and Validity_End_Date are present in Same Dim_Devices  Dimension Table.

Could you please help me to define cube structure and how to create such measure out of dim_table.

Global Cube/Offline SSAS Cube (Excel Export Offline Cube) Creation.

$
0
0

Hi Team,

I am trying to create SSAS Offline Cube or SSAS Global Cube based on OLAP Multidimensional Cube. Please provide me some information about different ways of creating it.

I have found few,

1. Using below Command

CREATEGLOBALCUBE [Global_CubeName]Storage'C:\Asset_Rationalization.cub'FROM [Cube Name]( --Measures, Diemension )

2. Connect to Excel.

 Set up connection out of deployed cube [Cube Name], create new power pivot report using required measures and dimensions and expert to offline cube.

But, I am unable to create it completely, as it seems that it does not allow me to create it if there are measures which are using "DistinctCount" agreegation.


Offline Cubes

$
0
0

Hi,

I have an offline cube (.cub file).

Is it possible to open this offline cube in SSAS?

Thanks.


Error while creating offline cube

$
0
0

Hi All,

while creating offline cube in excel iam facing below issue.

Microsoft OLE DB Provider for Analysis services 2005:

Query(3,2) Parser:The syntax for 'DIMENSION' is incorrect

could any one please let me the solution for above error

Thanks in advance

Last Year using Scope or Calculated Member - Rollup issue or Grand Total issue

$
0
0

Hi Folks,

I'm getting stuck with the calculation of the last year using MDX.

First I create a calculated member and the scope it like this:

CREATE MEMBER CURRENTCUBE.[Measures].[Sales Discount LY] AS NULL; SCOPE([Measures].[Sales Discount LY], [Time].[Date].Members); this = (Cousin ( [Time].[Year - Quarter - Month - Date].CurrentMember ,Ancestor ( [Time].[Year - Quarter - Month - Date].CurrentMember ,[Time].[Year - Quarter - Month - Date].[Year] ).Lag(1) ),[Measures].[Sales Discount]); -- Overwrite for weeks SCOPE([Measures].[Sales Discount LY], [Time].[Year - Week - Date].[Week].Members); this = (Cousin ( [Time].[Year - Week - Date].CurrentMember ,Ancestor ( [Time].[Year - Week - Date].CurrentMember ,[Time].[Year - Week - Date].[Year] ).Lag(1) ),[Measures].[Sales Discount]); END SCOPE; END SCOPE;

That works fine except that the grand total is not shown. Therefore I followed some suggestions and created a dummy named column and a real measure, then I overwrote the measure using the scope above and commented out the calculated member. Now I have the grand total, but the problem is some aggragations are not correct:

just to add more confusion, it only happens with one year.

What could be wrong? Any comment would be appreciated

Kind Regards,

Paul




How to Create measure of varchar datatype in SSAS cube

Custom Dynamic Calculations

$
0
0

I am fairly new to SSAS so I need a bit of direction on how to create some custom calculations in my cube.

The measure I have is Amount and this is a double field.

A dimension I have is GeneralLedger. Each GeneralLedger ties to a particular set of data, let's call them BudgetYear.

What I want is to be able to provide a variance to the end user, but what I have no idea of knowing is which two Amount's from some two BudgetYear's they will want to be displaying? It will all depend on what they decide to drag out to their columns.

Is this possible with SSAS?

Different Role permissions for different measure Groups

$
0
0

I'm trying to create a role wherein the user has access to two Measure Groups. However, if the user has a measure from Measure Group 1 on either Axis, then they can only information from one department. If they only have measures from Measure Group 2 on either Axis, then this limit is restricted. 

I believe I am close, with the following syntax:

IIF(
  CASE WHEN 

  NOT ISERROR(EXTRACT(AXIS(0), Measures ).COUNT) 

  OR 

  NOT ISERROR(EXTRACT(AXIS(1), Measures ).COUNT
 
  THEN TRUE ELSE FALSE END,

  [Department].[Department].&[Department1],

   [Department].[Department].MEMBERS
)

However, within the EXTRACT statement, I don't know how to specify second measure group. I've tried using MeasureGroupMeasures('MeasureGroup1') but this does not work. Does any one have any ideas on how I can limit a user's role when I know that a measure from a limiting measure group is on one of the axes?

Viewing all 14337 articles
Browse latest View live


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