I have a cube that contains a table with the following structure:
Level1 | Level2 | Level3 |
USA NY New-York
USA NY Niagra Falls
USA WA Washington
France Paris Montmarte
I want to query this so I get the following, using DAX:
USA
NY
New-York
Niagra Falls
WA
Washington
France
Paris
Montmarte
Is this possible to do in one DAX query? Its a representation of the hierarchy.
In the end I want to use this as a filter for an reporting services report, where the user should be able to easy navigate through the hierarchy.
Reporting Services understands hierarchies as represented in the first example. You can then use a matrix or tablix to represent the hierarchy however you want, including emulating an Excel pivot table, which is what it looks like you're trying to do. Example.
While I can think of several ways to represent the hierarchy by using significant whitespace as you've shown in the second example, I will not waste my time or yours, because there is no reporting tool I know of that would be able to make sense of the hierarchy represented in such a format. There is no need to format the hierarchy in the query.
Queries retrieve data. Reporting tools format and display the data prettily. No need to shoehorn reporting tool functionality into a query language.
Edit: I missed the section on using this as a filter.
Reporting Services does not have any native concept of a filter as a report element. Filters are typically implemented as parameters to the report, and you can set up those parameters to follow the hierarchy by making them cascading parameters.
If you'd like to have a report element that acts as a filter, then you can emulate slicers with report elements with some wonky workarounds, but it's not fun to implement, so it's time to start asking how much you want to do this in SSRS, or how much you need to have a specific visual implementation of the filter. Here's a resource on emulating slicers in SSRS.
You could do this based on a matrix, as described above, to represent the hierarchy visually and allow selections within that matrix to reload the report with new selections. It will not be fun. It will be clunky. It will not allow any sort of quick multi-select; i.e. if I want to select 5 items, I will have to go through 5 iterations of clicking on the element and waiting for the report to reload completely. Caching will be your friend.
Related
I am facing a situation where I have to replicate a report based on relational database with a report retrieving data from an OLAP cube.
The report I am trying to replicate displays leaf level data like the following:
Account | PersonID | Product | SalesQTY
When I try to replicate this report with MDX the problem is that Account and Person dimensions have too many members , so when I crossjoin them the system goes out of memory. I tried using FILTER() to narrow down a little bit but without success.
Note that there is only one axis.
How can I get the same result with the T-SQL query using MDX without performance issues?
I used NONEMPTYCROSSJOIN() function
I'm trying to build a simple report using SSAS Tabular model as datasource. There are two different dimensions in the model - UserGroups that should be used as first parameter and Regions as second one. These dimensions are M2M-related in the model. Simple measure calculated with the usage of M2M tricks for tabular models works fine in Excel and PBID.
I need those parameters to be cascaded in SSRS report. I.e. Regions dropdown should be filtered after selecting one ore more (Allow multiple values parameter option is ON) values in UserGroups dropdown.
After I put both dimension onto Filter pane in Query Designer I receive two parameters with hidden datasets. Everything looks fine but first parameters (UserGroups) actually do not filter Regions dropdown.
I think I understand the nature of the issue. We see the same picture in other client tools like Excel when placing M2M-related dimensions on the same rows/columns pane - second dimension displays in the Pivot Table all its members until we check a measure in Pivot Table Fields. All the members for the second dimension (Regions in my case) are vanished as soon as a measure comes into play - Excel is smart enough to wipe out dimension members if the measure value is null. But this does not happen in SSRS.
All the "automatic" cascading parameters creation works well within hierarchies of a single dimension. I hope this works as well with one-to-many related dimensions. But how can I extend/modify automagically-created MDX query for the second parameter dataset to be filtered out? It looks like SELECT ( StrToSet ( #[UserGroupsUserGroups], CONSTRAINED ) ) ON COLUMNS is not enough in this case. I need also to check measure value to filter out Regions list. Unfortunately I'm not an MDX expert. Please help me to inject this checking into the query.
You're on the right track and gave a good explanation of the scenario. As you found out, there is no automatic way to make the parameters cascade. You do need to add an MDX filter to the second parameter to make this happen.
As far as the actual query is concerned, there's not quite enough information to give you an exact query. But you would use StrToSet to pass in the first parameter and use the FILTER function to limit the scope. As you stated, including a measure is one way to get only the "NonEmpty" combinations of the two parameters. If you run into a specific problem with a sample query, feel free to provide more details on that.
Can anyone tell me how to use the Orange correspondence analysis widget?
I have a table of 11 columns of data with a first column of row names. I have tried to select the data using select attributes widget and connecting to the correspondence analysis widget. But, I did not get any result. Do I have to connect to another widget before the correspondence analysis widget?
Okay, I don't know what code I'm using. I don't know how to access code I was just using the visual interface, which I thought should do the job.
The input data for the correspondence analysis need to have discrete variables.
If you have continuous variables consider PCA instead.
For a simple example use of CA, load the smokers_ct.tab dataset and use it in CA widget.
I want to create a rdlc report using Microsoft Report Designer. Due to complexity of my data (the given below is just an example) I do not use View on Database side. So, I have to use seperate tables (data sources) for my report design. Now, as it can be seen the example below I have one report page and I want to show PERSONAL, FAMILY and JOB INFO for each person.
There are Textboxes on PERSONAL INFO section. The data is come from table_Personal,
There are a Table on FAMILY INFO section. The data is come from Table_Famiy,
There are a Table on JOB INFO section. The data is come from Table_Job
and all the three tables contain Person_Id column.
PERSONAL INFO
Name : Christof
Surname : Robin
Age : 45
FAMILY INFO
No----- Name----- Age----- Birt Place
1------ Sarah----- 12------ London
2------ Albert----- 16------ Manchester
3------ David----- 23------ NY
JOB INFO
No------ Company----- Start Year
1------- Xyz----------- 2005
2------- T Mobile------- 1999
3------- Day Inn------- 1993
My question is;
1) I do not want to use Subreport and do not combine these tables in db side by using view (I have searchhed, but for 3 or more tables it is impossible I think).
So, is it possible to create a master-detail report like above by grouping items (table, list, etc.) and without using subreport on rdlc? If so, could you explain a little bit please?
2) I have tried to create such a kind of report like that; I use a List and inserted all the textboxes and three tables above
to this list. I assign all the three tables as Report Data Sources. I make List.DataSetName = Table_Personal and List.Grouping settings
select Group on : Person_Id and some other combination. But, unfortunately I have not managed to create such a kind of report group like above.
Could you help me please by giving some advice and if you have some sample rdlc page source please? ...Shohel
Yes it is possible but I'd done it like 6 months ago, so I don't have any sample code right now.
I have done a lot of similar cases. One such case is there are a list of students and each student has a list of marks, a list of achievements, etc.
If I remember correctly I used one storedprocedure to get all the details of all the students. One dataset. And put 'em all in one tablix and grouped 'em.
The sub-lists (like the list of marks) are separate tablixes themselves and are inserted in textboxes of the main tablix.
Hope it helps! :)
I've got some criteria that we're surveying for our buildings. The reports are grouped by building and floor for several different sets of data (for instance info on Bathrooms, Meeting Rooms, Doors etc). Each report is for a different set (ie Bathrooms and Doors are seperate reports completely, drive from seperate queries).
These reports have math expressions such as calculating averages per floor/per building etc. I know, a lot of backstory here.
Bottom line is:
I need a way to take a field, let's say "TotalBuildingRating", which is the same across all 20+ reports, and produce a summary- a simple page saying
For building X: Bathroom Rating | Meeting Room Rating | Door Rating
80% | 50% | 60%
(ValueFromBathRpt)|(ValueFromMeetingRpt)|(ValueFromDoorReport)
Is there a way to do this without performing the math in SQL? It's quite complex at times... I'm completely lost as to how to do this. The individual data set reports are working perfect, but I cannot summarize them in one place.
Consider a subreport. Create it to provide the summary you need and then drop it into the report header or footer of any other reports.
I ended up opening all of the summary reports in the background for each group, and referencing them in my total summary using
IsError([Reports]![GroupOneSumm]![SumPercent], 1, [Reports]![GroupOneSumm]![SumPercent])
IsError([Reports]![GroupTwoSumm]![SumPercent], 1, [Reports]![GroupTwoSumm]![SumPercent])
and so on for each sum on the other reports. Not elegant, but it's working. I can call it a "feature" that the summary also shows you the details in other windows... The IsError() is because if one of the other reports has no data, it comes up with an error in [SumPercent]. Since it's empty, its rating is 100%, thus ], 1, [.