row header in mdx queries - header

Can anyone explain how to add row headers to the following query? I'm sure there is a way, surprised that the column headers appear but the row headers are null.
By row headers I mean the top of the returned data, in gray that actually shows the name of the row returned.enter image description here

That is SSMS and the way it displays the data.
In MDX Studio we get this:
...but SSMS and MDXStudio are not front end clients so this is just the way they have been designed.
If you are using say Excel as a front-end then you will maybe use a pivot-table to display the data - column headers will be the same as any other pivot table
If you are using SSRS then you can name the columns in your Datasets.
Other front-end clients will deal with this differently.

Related

How to group a text row in multiple data rows in Microsoft Report Builder

Basically I'd like to from this :
What I have
To this :
What I Want
Case in Orange are data that I pick up with an sql request while "This e-learning phase..." is just a plain text.
Does anybody knows how to do that ?
You could add a Parent Row Group and Group by the Information field.
Unfortunately, this would place the Information on the Left side of the table. Fortunately, there is a Layout Direction property for the table that can be switched from LTR to RTL so that the table is created from Right to Left instead of the default Left to Right.
This way the grouped information field on the right would only have one cell while there may be multiple Activities.
I'm not sure you'll be able to do this exactly how you want. This is because you cannot add rowgroup columns after non-grouped columns.
The only way you could get close is to not show the text if it's not the first row in the dataset (or rowgroup if the report is grouped somewhere)
You could use something like this in the Value expression.
=IIF(
ROWNUMBER("myDataSet_Namehere") =1,
"This e-learning phase must be completed before the start of the classroom part indicated below.",
Nothing
)
You could use a similar check to then set the vertical alignment property.
It looks like this...
The other option would be to move the test to the top of the table on it's own row in above the column headers, it would probably look neater..
Or you can wait for somebody else to come up with a better solution :)

Display fixed number of rows on a tablix in SQL Server Reporting Services

I have a report made in SQL Server Report Builder and I would like to show a fixed number of row per table, not per page.
I found out this expression =CEILING(RowNumber(Nothing)/25) and probe it on the row group, bit did not work.
In the image above, I want to fixed the number of rows where the <> is going to be populated with database data.
How can make this?
In the Group properties add this as a Group on expression:
=CInt(Ceiling(RowNumber(nothing)/25)). Let me know if this works for you :)

Dynamic Parameter in Power Pivot Query

We are using Excel 2013 and Power Pivot to build modules that consist of several Pivot tables that are all pulling data from the same Power Pivot table, which queries our T-SQL data warehouse.
In an effort to simplify and fully automate this module, we wanted to create a text field that would allow a user to enter a value (a client ID# for example), and then have that value be used as a parameter in the Power Pivot query.
Is it possible to pass a Parameter in the Power Pivot query, which is housed in a text field outside of the query?
You can also pass a slicer or combobox selection to a cell. Define a name for that cell. Put that cell (and others if you have multiple text variables to use) in a table. For convenience, I usually name this table "Parameters". You can then 'read in' the parameters to your query and drop them in your query statements.
The code at the top of your query to read these parameters in might look like...
let
Parameter_Table = Excel.CurrentWorkbook(){[Name="Parameter"]}[Content],
XXX_Value = Parameter_Table{1}[Value],
YYY_Value = Parameter_Table{2}[Value],
ZZZ_Value = Parameter_Table{3}[Value],
Followed by your query wherein instead of searching for, say a manually typed in customer called "BigDataCo", you would replace "BigDataCo" with XXX_Value.
Refreshing the link each time a different customer is selected will indeed be a very slow approach, but this has worked for me.
Rather than pass a parameter to the data source SQL query, why not utilize a pivot table filter or slicer to do allow the users to dynamically filter the data? This is much faster than refreshing the data from the source.
If for some reason you need to pass this directly to the source query, you'll have to do some VBA work.

Can you insert/update/delete rows in LinqPad via a grid?

Perhaps this is beyond the purpose of LinqPad, but does it have this functionality that is available in SQL Management Studio?
I want to seutp some quick data but don't want to have to write code to do it. I just want to type it in.
Yes, provided your tables have primary keys set.
All you have to do is put your results to data grids (Ctrl+Shift+G) then query the table you want to add rows to. If you're just adding rows and don't need to see existing rows, you can filter it out (YourTable.Take(0)). The key is to make sure that the query type is IQueryable<YourTable>.
You will be presented with a grid of the results of the query. There should be a button up top to Edit Data. There should be an empty row at the end (or you could click on Add Row) where you can enter your data.

MS Access - Query bringing in "new record" row

I have a query that will be populating a form and then the form will allow the data set to be edited. The issue I am having is that the query is pulling the last row that is normally used to add a new record. This results in having a row that looks shows all fields as blank, but leaves one field with "null".
I played around with the query and was able to find a workaround by selecting "distinct" records, problem is that when you select with distinct, you cannot edit the data set. Is there any other way around this?
I can upload an example of the database if needed.
Thanks!
edit: picture to show the issue: https://imgbomb.com/i/?rO1sp