Could you tell me how can I group values in an attribute in one dimension in SSAS.
I one attribute one one dimension there are a lot of values and I want to group it according to some criteria How can I do it?
The Discretization” method is not working properly
thanks
Related
Usually I display a value for dimensions by using the CurrentMember.Value/caption as as an alias.
For the following query this breaks with an error along the lines of
'The hierarchy [Measures] appears in more than one axis or in an axis/axes and a slicer too'.
Which I understand.
So how do I edit/expand the query such that I see the book values on rows (normally achieved with
'WITH Member [Measures].[Book_Label] AS [Book].[Book].CURRENTMEMBER.MEMBER_CAPTION'
and the column dimension values along the top?
(Excel image below, values white color'd out as on client site.)
SELECT
NON EMPTY ([Ccy].[Ccy].[Ccy])
ON COLUMNS ,
NON EMPTY
([Book].[Book].[Book])
ON ROWS
FROM [TraderCube]
WHERE
([Date].[Date].[ALL].[AllMember].[2019-12-12],[Measures].[JTD.SUM])
I have made more progress however this comes out staggered duplicating the row / book label at each repeated currency.
Does anyone know how I would:
1) Get the currencies along the top?
2) Have one row / book label per row?
WITH
Member [Measures].[Book_Label] AS [Book].[Book].CURRENTMEMBER.MEMBER_CAPTION
SELECT
NON EMPTY (HIERARCHIZE(([Ccy].[Ccy].Members, {[Measures].[Book_Label],[Measures].[JTD.SUM]}), POST))
ON COLUMNS,
NON EMPTY (HIERARCHIZE([Book].[Book].Members, POST))
ON ROWS
FROM[TraderCube] WHERE ([Date].[Date].[2019-12-13])"
As an update for anyone who comes across this thread/question, for me I am writing a C# layer that translates simple user words and constructs MDX. I query the remote cube and then I return a 2D array. Up until now I constructed the headerRow etc myself and I returned the row dimension labels using the MDX itself.
I have now discovered that metadata is available on the AdomoClient libraries I am using.
This tutorial has inspired me:
https://www.codeproject.com/Articles/28290/Microsoft-Analysis-Services-2005-Displaying-a-grid
It's not a direct answer to my query of getting all of the labels in MDX but it will mean I can construct my headerRow (may be more than one row as seen in Excel pivots) and populate my row labels differently using the positions property of each Axes on the set (Axes[0] is columns, Axes[1] is rows) and the Positions property has a member property too.
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.
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.
I'm creating a member in an mdx query containing my slicer information and the last one is my measure. When I add a set to my tuple (for having multiple slicers on one dimension), i get this error.
This function expects a string or numeric expression for the argument.
A tuple set expression was used.
When I add one of the 2 members of my set to my tuple, I don't get this error.
what does this mean, I don't really know what to make of this, fundamentally there isn't a difference between adding a slicer or
A tuple is a cell. A set contains cells. A set cannot be one of the coordinates of a tuple, as the end result is not a cell (a cell is given by 1 and ONLY one member in each dimension, where unspecified members will be taken to be either the All member or the Default member.
The way around it is by creating calculated members:
With Member [Time].[Current Period] as { [Time].[2013], [Time].[2014] }
Select (... your query here ...)
Where ( [Products].[My product], [Time].[Current Period], ... )
In the slicer you in fact have a tuple, as in each dimension a single member is specified. The fact that the member on the Time dimension is not a "pure" member coming from a dimension table column but instead is a calculated member has no influence.
Without your actual code it is difficult to help you.
Anyway, from your question it seems you are confused with sets and tuples (e.g., you cannot add a set to a tuple). I would advise you to check a MDX tutorial explaining these basic concepts: e.g., the icCube gentle MDX introduction should be fine for that.
How do i hide an attribute from appearing as a field when creating a pivot table.
e.g. i dont want the user to see the PK of a dimension. Thanks
Within SSAS, set teh AttributeHierarchyVisible value to false on the value of the dimension that you wish to hide from client tools. You will find this property available on each of the dimensions attributes.