I am having problem trying to group my dimension by the year using SSAS. This is the first time for me deploying a cube. Is there any way so that I can simply group the year rather than seeing multiple lines of the same year (please see the attached image)
Check the KeyColumn property of the attribute GL Year, if the value of the Key is equal, they'd be automatically grouped. What you see in the list is the NameColumn property.
More info on MSDN and on MSSQLTips.
Update:
For KeyColumns property, MSDN states:
Contains the column or columns that represent the key for the attribute, which is the column in the underlying relational table in the data source view to which the attribute is bound.
This means whenever the value of the column(s) specified in this property are equal in the underlying table for any number of rows, SSAS will treat all these rows as one Member.
In your example, say if you have a column GLYear in your relational table and in KeyColumns property you have specified the same column, the resultant list in your screenshot will have a single value for each year. Hence, all rows with value 2015 will be combined together to form a single member in that list.
Related
For some time now I have the impression that a field and a column are the same thing in SQL server but today I stumbled across the statement that they are not actually the same thing. It was stated that a field is the intersection of a row and a column, so if a table has 10 rows and 10 columns it will have 100 fields in total.
I looked at Microsoft Docs and this is what it says:
A column is collection of cells aligned vertically in a table. A field is an element in which one piece of information is stored, such as the eceived field. Usually, a column in a table contains the values of a single field.
In this case then it looks like they are not the same thing.
I would highly appreciate it if someone can clarify this! Thank you in advance!
A field is part of a row, not a table, a "column of a row", if you will.
However, a lot of people use these terms interchangeably, and you can (read: have to) often deduce what they actually meant by the context of the sentence.
In some contexts, a field may refer to an element within a data value, where a column contains the entire data value. A common example is a date data type, where the month, day, and year are fields within the column. Spatial data types (e.g., the PostGIS data type in Postgres) is another example, where the x coordinate, y coordinate, and spatial reference ID are all fields within the column. Some kinds of identifiers have application-specific fields within them, where, for example, the first two characters carry some information, the next four characters convey some other information, etc. In cases like these, the distinction between column and field is important.
I'm currently running Visual Studio 2010 for reporting for pharmaceutical batch production. The system creates archive data table with the following fields:
-VARIABLE, which is the name of the variable,
-TIMESTAMP, the time when the value of the variable was recorded,
-VALUE, the actual value of the variable at a specific timestamp,
and so on.
The dataset I'm concerned with contains 3 variables: Level, BatchTimer, and BatchID.
Goal: What I want to achieve is to have Level as the Y value, BatchTimer as the X-axis(Category Group), and BatchID as the Series Group. Therefore I tried putting the VALUE field for all three regions, and adding filter options for the Category Group and the Series Group. Here are the filter options I added:
Filter Option for Category Group
Filter Option for Series Group
The problem now was filtering the Y value so that it only has field VALUE of Variable Level. I then assumed I needed to add a filtering expression to the value region of the chart data, which I don't know how to.
So my question is:
Is this the correct way to approach my goal?
If so, how would I go about filtering the Y value so that it only shows a certain variable in a dataset(in my case, Level)?
Thank you in advance!
If I understand your problem statement correctly, Your end goal is to filter out Level values, i.e For Example Level has values 1,2,3..10 but you want your Level values to be let's say only 3.
So return all data where level is 3. Once you have this datset, you are already able to add BatchTimer as the X-axis(Category Group), and BatchID as the Series Group.
You need a Parameter of a Filter in your dataset something like below.
Now above way is static for Level=3.
How do we make it dynamics
We create a Parameter and ask user to give level. Then depending on this parameter value we filter dataset as below ( this should be added to dataset query)
level field Operator: = and value of the parameter
(Parameters.level.Value)
Edited:
Let me try to explain more clearly. I wrote the earlier message in haste:
I have a sub-summary part which is sorted by the parent table's ID field. In this part, i have placed a summary field from the child table ( on which the layout is based ). This summary field is a running total of a number field in the child table , with restart checked. When this field is placed in the sub-summary part, it summarizes the values of all the records below it. Which is fine. What i want is to show that summarized value in each of the records just below the sub-summary. So for instance if the summary field shows a total of 1,000, then i want to show that 1,000 in each child record below in the layout. Then when the next break occurs and the field summarizes the next set of child records in the sub-summary I also want it to show the same value in the next set of records below it. I hope it's a little more clear.
It's difficult to understand what your question is. Some statements do not make sense at all. A sub-summary part is based on a field, not on a table. And a summary field is not "sorted".
If you want to show a running total in the body, without restarting at each break, you must define your summary field so. A summary field does not have to restart in order to show sub-summary values when placed in a sub-summary part.
Added:
A summary field displays the sub-summary value only when it's placed in a sub-summary part. If you want to show the same value elsewhere - or use it in a calculation, you must use the GetSummary() function.
Note that the GetSummary() function will only work if the break field is a local field. If you're grouping by parent, make sure you're using the foreign key field in the child table - not the primary key field in the parent table.
I am trying Sense/Net Community edition features.
I defined and installed content type called "Vacation Request" successfully.
I want to know what is the purpose of "mapping" field in table: SchemaPropertyTypes
Many thanks,
I really, really hope you are asking this only out of curiosity, and not because you want to change something manually in the db - because it is not recommended :). Please always access the content repository through the API, do not query or modify the db directly.
Property types and values
Simple property values (like int or short text values) are stored in the FlatProperties table. This is a fixed-with table, containing a predefined number of columns dedicated to different types (e.g. x pieces of string columns, y pieces of int columns - see column names in the table).
Property definitions are stored in the SchemaPropertyTypes table, as you have found out.
The zero-based Mapping field in the SchemaPropertyTypes table defines the column index in the FlatProperties table for a particular property. E.g. a value of a string property with mapping 6 will be stored in the FlatProperties table's 'nvarchar_7' column (note the index is shifted by one, because the column name index is one-based).
If you take a look at the PropertyInfoView view (not table), it may help clarifying this: the last column of the view is a computed column that displays the column name that you can look up in the flat properties table.
(there are other useful SQL views there that display data in a more readable way)
Property 'overflow'
It is possible to register more properties of the same type (e.g. int) than can fit in one row in the FlatProperties table. Solution: Sense/Net stores these nodes in multiple rows - this is why there is a Page column there.
Although MS SQL Server supports a huge number of columns for some time, this design has been kept for compatibility reasons.
This is why you see mapping values in PropertyInfoView like 249 with column name nvarchar_10: the value is stored on page 3, which means that content occupies 3 records in the FlatProperties table.
'Other' property types
You may have noticed that in case of reference or long text properties there is no mapping. This is because we do not store them in the FlatProperties table, they have their own tables like ReferenceProperties or TextPropertiesNText.
I need some basic help with SSAS 2012. I have my employees dimension. Here is an example:
Here is my hierarchy, the default one when creating the dimension:
My problem is that when querying the cube through excel, when showing only the name, it appears twice. I know it has two different IDs, but I am not showing the ID, just the Name in the columns and a value in the Metrics.
It appears like this:
How do I make it group correctly?
Thanks
Change the KeyColumns of the Employee Code attribute to just the Employee Code field (the column called Name on your table). Including Employee Key as the key in the Employee Code attribute is the issue. It should just be in the KeyColumns for the EMPE KEY attribute.
I didn't see any problem in your dimension in the technical perspective.
If you just need a distinct value in Excel, you just need to configure the pivot table property to 'group' the duplicate name:
Right click the pivot table in Excel book, find the menu over there.