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

How to implement CASE statement in evaluate function in Filters using DAX for SSAS based Reports

$
0
0

Hi,

I have some issues when implement the IF condition inside the IF condition to related two tables in Parameter Filter condition.

Please find the sample query below,

evaluate

summarize (

calculatetable(

'BM',

IF(@parwl="ALL",1=1,pathcontains(@parwl,'BM'[W_L])),

IF(@parsroom ="ALL",1=1,pathcontains(@parsroom,'BM'[Sroom] )),   

IF(@parmtype ="ALL",1=1,pathcontains(@parmtype = (IF[M_Type].[char_nm]='M_TYPE',

[M_Type].[char_val_txt],"NULL"), 'BM'[M_Type])

),

 'BM'[Item_Id],

 'BM'[W_L],

 'BM'[Sroom],

.

.

.

.

.

.

.

.

.

.

.

.

 )

In this query the 3rd parameter(parmtype) i want to compare the condition as like below with two tables in parameter filters.

Equivalent SQL:

sel col1,col2,col3 from table1 (where case when table4.col1 ='M_Type' then table4.col2 else null end in (?) or 'ALL' in (?))

group by 1,2,3

the above query is using in SSRS report now i want to implement the same in DAX

Main Dataset Table:

[BM]
compare against Dataset Table:
[M_type]

i want to compare based on the column value has two values 'Machine_type' & 'Item_Category'. if the condition as 'Machine_Type' then it should take the values from other table column([M_Type].[char_val_txt]) and have to compare against [BOM] table column else it should give as NULL.

[M_type] Table result:
ID      Im_Categor     Im_char_txt
1       M_Type        XYZ
2        I_Category    ABC
3       M_Type          UVW
4       I_Category     DEF

[BM] Table Result:
ID    s_roomm      M_Type
1102XYZ
2      103              ABC
3104              UVW
4105                 DEF
M_Type table i am going to use it a Parameter dataset.
In  main dataset ([BM]) if i will give any M_type as XYZ, then it should seacrh like below condition in Main dataset filters

sel col1,col2,col3 from table1 (where case when M_type.Im_char_txt ='M_Type' then BM.M_type else null end in (?) or 'ALL' in (?))


I want to write same like above condition in DAX on above mentioned query.

I have tried few method as like above. But not sure how to write the queries for two related tables related in SSAS model.



Customising the aggregation for Entire dimension.

$
0
0

Hi All

I have a aggregation related issue.Where the measure is calculated in cube. I cannot bring the calculated values  from the database as my measure is, running sum, calculated over time with the MDX function PeriodsTodate().and they want to have aggregated Summed values over other dimension than time.Currently I have used leaves() function similar like below:

Calulated Measures: M_CALC = SUM(PeriodsTodate([Date].[Month].([All])),[Measures].[Measure1])

SCOPE(Leaves(Product),[Measures].[ActDisplay])
This = [Measures].[M_CALC]
END SCOPE;

Where [Measures].[ActDisplay] is the actual measure to be displayed. and it is a empty  real measure created in the database.This approach I have used to resolve the aggregation issue over my product dimension over all the heirarchies. But my cube has huge amount of data which is resulting is perfomance issues for the user. Do you have any alternative approach for this that I can user it to show SUM aggregation over all the heirarchies within a dimension.

Thanks a lot and best regards,

DAX incompatible with Tabular model, but working in Power BI

$
0
0

I have created a small tabular model to convert my fact measures in diff currency to USD.

4 tables are -

1. FactAmount (fact table, measures)

2. Exchange Rate (fact table, conversion value from different currency to USD and viceversa)

3. Currency (Dimension, distinct currency values like USD, INR ..)

4. Date (Dimension, date values)

I created relationship between facts and dim.

FactAmount is joined with Date and Currency and similarly ExchangeRate is joined with Date and Currency.

I tried below formula to convert measures  to USD-

RatetoUSD:= 

var CurrentDate = RelatedTable('Date')

var CurrentCurrency = Distinct('FactAmount' [Currency])

Return

LookupValue(

ExchangeRate[AverageRate],

ExchangeRate[CurrencyName], Distinct('FactAmount' [Currency]),

ExchangeRate [Date], Calculate (MAX('ExchangeRate'[Date]), 'ExchangeRate' <= CurrentDate,

ExchangeRate[CurrencyName] = CurrenctCurrency,

ALL(ExchangeRate)

)

)

Issue is value of var CurrentDate should be (it should use Related and not RelatedTable)

Var CurrentDate = Related('Date'[Date])

But Related is throwing error in Tabular. But Related function is working in PowerBI and its giving desired results.

please suggest


ERROR: SSAS Tabular 1400 - Connect to Dynamics 365

$
0
0

I am getting the following error trying to connect to our Dynamics 365 CRM when building a 1400 Model.  I can successfully connect via Power BI and Excel.  I am unsure what the resolution should be to get this assembly, as I cannot locate it on the machine.

Details: "File or Folder: Could not load file or assembly 'Microsoft.OData.Edm.NetFX35.V7, Version=7.4.0.11102, Culture=neutral PublicKeyToken=31bf3856ad364e35; or one of its dependencies.  The system cannot find the file specified."

I am running VS 2017 Community 15.8.1 and SSDT 15.7.1 on Windows 8.1 Pro.  My Local Instance of SQL Server is 2016

I am able to successfully connect on a personal computer running Windows 10, SQL Server 2017, same VS / SSDT Configuration and also locate the dll for the referenced assembly. 

I suspect I either need to upgrade my OS or install a SQL Server 2017 instance locally?

Any suggestions or resolution?

problem with project deploy after new 2017 install

$
0
0

Hi,

I have recently installed sql server 2017 and SSMS and SSDT

the SSMS, SSIS are working fine.

When I tried to deploy a SSAS project - I am getting a weird error: 'A device attached to the system is not functioning'

I looked it up and it seems that there is an issue with a locale setting, but I can figure out how to fix this.

Can someone familiar with this issue help?

Thanks,

Dani

Who will be announced as the next Small Basic Guru? Read more about August 2018 competition!!

$
0
0


What is TechNet Guru Competition?

Each month the TechNet Wiki council organizes a contest of the best articles posted that month. This is your chance to be announced as MICROSOFT TECHNOLOGY GURU OF THE MONTH!

One winner in each category will be selected each month for glory and adoration by the MSDN/TechNet Ninjas and community as a whole. Winners will be announced in dedicated blog post that will be published in Microsoft Wiki Ninjas blog, a tweet from the Wiki Ninjas Twitter account, links will be published at Microsoft TNWiki group on Facebook, and other acknowledgement from the community will follow.

Some of our biggest community voices and many MVPs have passed through these halls on their way to fame and fortune.

If you have already made a contribution in the forums or gallery or you published a nice blog, then you can simply convert it into a shared wiki article, reference the original post, and register the article for the TechNet Guru Competition. The articles must be written in September 2018 and must be in English. However, the original blog or forum content can be from before September 2018.

Come and see who is making waves in all your favorite technologies. Maybe it will be you!


Who can join the Competition?

Anyone who has basic knowledge and the desire to share the knowledge is welcome. Articles can appeal to beginners or discusse advanced topics. All you have to do is to add your article to TechNet Wiki from your own specialty category.


How can you win?

  1. Please copy/Write over your Microsoft technical solutions and revelations to TechNetWiki.
  2. Add a link to your new article on THIS WIKI COMPETITION PAGE (so we know you've contributed)
  3. (Optional but recommended) Add a link to your article at the TechNetWiki group on Facebook. The group is very active and people love to help, you can get feedback and even direct improvements in the article before the contest starts.

Do you have any question or want more information?

Feel free to ask any questions below, or Join us at the official MicrosoftTechNet Wiki groups on facebook. Read More about TechNet Guru Awards.

If you win, people will sing your praises online and your name will be raised as Guru of the Month.

PS: Above top banner came from Paul Long.

Thanks in advance!
Ninja [Kamlesh KumarTechNet Wiki Council



Thanks,
Kamlesh Kumar

If my reply is helpful please mark as Answeror vote as Helpful.

My blog | Twitter | LinkedIn

This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.


Server Sizing for SSAS cube 3TB, data size of 7 TB on server. What configuration should I select?

$
0
0
What would be the hardware requirement for Server with 3TB of ssas cube and 7TB of data, the RAM required, Processor cores, Hard disk drive ? Can someone please suggest what things I should consider while choosing the server configuration.

How to handle infinity values in dax?

$
0
0

I have one measure which is showing infinity values when i am exporting data from power bi visual so can you tell me? how i can handle the infinity values using Dax function in the SASS measures. 


stop table from processing

$
0
0

Hi,

i have an SSAS tabular model connecting to a SQL database with multiple tables.  I also have a separate lookup table connecting to a different SQL database.  the model processes daily against both sources, but i would like to stop the lookup table from processing as it does not change.  Is there a way to tell the model to not process a table when doing a full process?

thanks

scott

Internal error: An unexpected error occurred

$
0
0

Hi,

I have a cube that i connected from Excel using an OLAP connection when i'am trying to use a filter with a diemension that contain Hierarchy i have this error 

internal error: an unexpected error occurred excel

I think this issue come from attribute because it's contains duplicate value because it's a parent of hierarchy because

i can use other Filter and i don't have any issue 

For information the attribute of dimension come from 3 tables

How can i fix that ?

Thanks 

Aggregation Error

$
0
0

I am using Visual Studio Enterprise Edition 2017 with SSDT tool and while analysing I am facing error with Aggregation and that dialog box have a message "An error prevent the video from loading" with additional information "System.Drawing.Bitmap" method not found.

Also it has some detail like "Microsoft.Sqlserver.Management.UI.Grid.GridConstants.get_IntermidiateCheckBoxBitmap()"

(Microsoft.AnalysisServices.Controls)

If anyone knows please send a reply to solve this issue

Rolling 12 months showing wrong sum on grand total

$
0
0

Hello everyone!

I am trying to get the Rolling 12 months for a certain measure, it is working when i am selecting a single period but when i am selecting 2 periods the grand total showing wrong sum. Below is my R12 MDX.

SUM(

   (ParallelPeriod(

[PERIOD].[Calender].[Year]

,1

,ParallelPeriod([PERIOD].[calender].[PERIOD], -1, [PERIOD].[calender].CurrentMember)

)

:

[PERIOD].[calender].CurrentMember)

,[Measures].[Sales]/12

)

This is how my result when i am selecting 2 periods.

Period                 Sales  R12

201807               4000

201808                4000

Grand Total           9000   : sum should be 8000

could any one guide how to get the correct grand total. Thanks in advance.

Kind Regards

Mah

SSAS with Power BI

$
0
0

Hi 

I have created a SSAS tabular model and I want to create reports using SSAS model in Power BI. Can someone please suggest which options would be better and widely used. for example LIVE or store data on Power BI APP server ? Please share best possible approaches from BEST practices.

How to ProcessAdd Multi-DSV Table Based Dimension

$
0
0

Hi,

I'm using multidimenional model.

I know there are plenty examples online, but all I have found is appending a dsv along with the xmla command specifying the dimension's underlying table structure and the query containing rows to be added. Like it says in this article http://www.artisconsulting.com/blogs/greggalloway/2007/4/20/processadd-examples

In my case, I have a dimension that is based on more than one dsv table. (e.g. There are two table a,b in dsv, there is a proper relationship defined between them. Create a dimension based on table a. Open the dimension, in the data source view pane, click show related tables where table b will show up. Add table a and b 's columns as attribute into the dimension. Now this dimension is two dsv table based.) 

I think I need to provide a query like this: select a.*,b.* from a inner join b on a.key = b.foreignKey and dsv for both tables. But there isn't an example online showing me the correct format of doing this.

I know I can create a view upon the two table making it one dsv table, but the dimension in my case is dynamic and may have more than 1024 columns which prevents me creating view upon them.

Please help me out here if you have experience with this, thanks.



Moving Measures in a separate table (PBI & SSAS 2017 Live Connection)

$
0
0

Hi,

I’m using SSAS 2017 to store my tabular model.  As frontend I’m using Power BI Desktop Release March 2018.
Because in the meantime I have a huge amount of measures (stored in SSAS 2017 tabluar mode) I want to  structure and group them. Of course I could use display folders but I would rather prefer to a separate “measure table”.
From the PBI Desktop I already know that measures are “table inspecific”, so they can technically live anywhere. Furthermore, I know how to move measures between tables (or to a specific measure table) easily in Power BI.
But as far as I experienced it with the tabular model in SSAS this easy way is not possible. In fact, I have to cut out the measure from one table and paste it into the new location/table. Thus, actually I have to recreate them.
The disadvantage accompanied by this approach is that the connection to the moved measure gets lost in the PBI Desktop and I receive and error in my PBI report that the measure is not available anymore.

Is there any other way to move a measure in SSAS 2017 in the way you can do it in Power BI Desktop?

Thanks a lot.

Best regards,

Dom


Failure when importing Hadoop data into a SSAS Tabular cube.

$
0
0

Hi,

I am receiving an error when attempting to import Hadoop data into a SSAS Tabular cube.

In the 'Specify a Connection String' window I give a Friendly name for this connection of 'Centre_table'.
I then choose the 'Build...' to bring up the below window.



In the 'Impersonation Information' window I choose 'Specific Windows user name and password' and submit my username and password. When I test the connection it succeeds as shown above.

In the 'Choose How to Import the Data' window I choose 'Select from a list of tables and views to choose the data to import'.

So you can see the SSAS Tabular connection is seeing the Hadoop tables.
I then click 'Finish' and receive the below error.

I should note the SSAS Tabular project is showing in SSMS (see below for 20180906).

What is this error message saying?

I should point out the following two things I've tried to help narrow down the issue:

1) As Visual Studio is 32bit, I open 32bit Power BI and connect to the same Hadoop source using the same 32bit ODBC System DSN as I use when receiving the failure above. The 32bit Power BI successfully imports the single Centre table that I chose.
So it would suggest that my laptop is within any firewalls (both visual studio, power bi, and ODBC system DSN is running from my laptop), my user credentials have access to the Hadoop source, and the 32bit ODBC driver is configured correctly on my laptop and is allowed by any Hadoop policies.

2) I then created a SSAS Tabular project to bring in a simple Excel file into SSAS Tabular cube. This succeeds. I then use Excel again to connect to this SSAS Tabular cube to see if can connect and use the original source Excel file via the SSAS Tabular cube. Yes, it works.
So this would suggest the instance of SSAS Tabular, the importing of data, the connecting to the cube all work.

Can someone please inform me of what the issue I'm facing is?

Thanks.


Reference Relationship show error 'Errors in the metadata manager. the intermediate granularity attribute of the measure group dimension does not have an attribute hierarchy enabled

$
0
0

I've 2 dimension and 1 fact table like this

FACT CONTRACT

- CONTRACT ID

DIM LOCATION CONTRACT

- CONTRACT ID

- LOCATION ID

DIM LOCATION

- LOCATION ID

I create regular relationship between FACT CONTRACT and DIM LOCATION CONTRACT. It fine.

But when I create reference relationship between DIM LOCATION CONTRACT and DIM LOCATION but it show error when deploying process like this 'Errors in the metadata manager. The 'LOCATION ID' intermediate granularity attribute of the 'DIM LOCATION CONTRACT' measure group dimension does not have an attribute hierarchy enabled.'

Please help me,

Pimporn

Alternative for Greatest function to get latest date

$
0
0

Hi All,

I have a cube, which has many partitions. 

The monthly partition query is like - 

SELECT * FROM loc_view WHERE greatest(CDATE,CDATE_P_C) between TRUNC (SYSDATE,'YEAR') and (TRUNC(SYSDATE, 'MONTH'))- INTERVAL '1' SECOND

and similarly there is daily partition query and hourly partitions query.

I observed that using GREATEST function is causing the cube to take more process time. in this partitions I should get data based on whatever is the latest date. Is there any other alternative to GREATEST? So that it may decrease process time.

Whenever a parent item is updated, the CDATE gives updated date for only  for parent item. And CDATE_P_C gives updated date for parent and its corresponding child items. So I am using both dates

Please suggest.

Thank you


sania

Multidimensional Personalization Extensions are Unreasonably Slow

$
0
0

It has been some time since we first started using personalization extensions for analysis services.

See: Personalization Extensions

They are quite powerful, and the users who have discovered them are now building more and more custom members, for their ad-hoc reporting purposes.  The primary types of items that users want are personalized sets, and calculated members.  These are introduced into the cubes during the "CubeOpened" event by calling "CREATE SET" and "CREATE MEMBER".

The problem we are experiencing nowadays is that users are taking this feature further than what I had expected.  They are using them to create hundreds of ad-hoc custom sets and members.  When these users connect to the cubes in their Excel workbooks, it can take 30-60 seconds for the SET's and MEMBER's to get created.  This means they have to wait a long time before they can even start making queries against their pivot tables.

Moreover, there doesn't seem to be a way to create more than one at a time.   They have to be requested individually , via AdomdCommand ( Link ).  I've found that as you keep calling CREATE MEMBER, the operations get increasingly slower (ranging from 1 ms each at the beginning to about 30 ms each after 500 members have already been created).

Can anyone tell me if they've used personalization extension to this extent, or encountered this scalability problem when using lots of SET's and MEMBER's?  I'd really like to be able to create a large number of custom calculations (via CREATE MEMBER) without getting bogged down.  As near as I can tell, the programming interface doesn't allow the bulk creation of multiple members, nor does it allow a personalized calculation script.  Any pointers would be greatly appreciated.


David Beavon


AdomdDataReader removes columns that specify the [All] member

$
0
0

Hello, 

I've recently switched from querying via CellSet to querying via DataReader and it is a great improvement in terms of performance. There's just one problem with it: When specifying the [All] member on a column, the AdomdDataReader will not have that column with it's [All] value in every row. The CellSet does have that column. 

Is there any option or any other way to also retrieve these columns via the DataReader? 

I've found this very old SO post with one answer with one answer that states that this behavior is by design. Can it still be deactivated? 

https://stackoverflow.com/questions/13195679/column-getting-removed-after-retrieving-data-using-adomd-adapter-if-it-contains

Thanks in advance and best regards,

mf00

Viewing all 14337 articles
Browse latest View live


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