I am having a miserable time trying to recreate part of a pivot table in SSRS. You know when you connect to a cube in Excel, then add measures and other data points, how Excel nicely puts things together for you, including giving you grand totals? Well I am trying to recreate this in SSRS in Query Designer and having no luck. This is day three I'm still stuck on this.
What I can create is all of the dataset along with the proper filters. It's those grand total columns that Excel magically created that I can't get. I need those the most for my SSRS report.
Here is the MDX that I currently have. It works great except that in Query Designer in Visual Studio the grand total column for "Total Calls" is not appearing.
Does anyone know what to do or how to get that grand total column?
Please help.
SELECT
NON EMPTY
{
[Measures].[Total Calls], [Measures].[Total Moves]
}
ON COLUMNS,
NON EMPTY
{
([To Person].[Department].[Unit].ALLMEMBERS * [From Person].[Location].[City].ALLMEMBERS * [From Person].[Support].[Person].ALLMEMBERS * [From Person].[ID].[ID].ALLMEMBERS)
}
DIMENSION PROPERTIES MEMBER_CAPTION,
MEMBER_UNIQUE_NAME
ON ROWS
FROM
(
SELECT
(
STRTOSET(#MDepartment, CONSTRAINED)
)
ON COLUMNS
FROM
(
SELECT
(
STRTOSET(#Weeks, CONSTRAINED)
)
ON COLUMNS
FROM [PersonTransf]
)
)
WHERE
(
IIF
(
STRTOSET(#Weeks, CONSTRAINED).Count = 1,
STRTOSET(#Weeks, CONSTRAINED),
[Date].[Sun Weeks].currentmember
),
IIF
(
STRTOSET(#MDepartment, CONSTRAINED).Count = 1,
STRTOSET(#MDepartment, CONSTRAINED),
[From Person].[Department].currentmember
)
)
CELL PROPERTIES VALUE,
BACK_COLOR,
FORE_COLOR,
FORMATTED_VALUE,
FORMAT_STRING,
FONT_NAME,
FONT_SIZE,
FONT_FLAGS
Did you try adding a column outside the group then just put SUM(Fields!YourMDXColumn.Value) on the cell?
Related
I'm currently working at a SSRS Report who use a SSAS Connection with Shared dataset.
I changed the parameter in the shared dataset, changed the input parameter and the parameter in Report dataset
If I wanna preview it , I get the error
The Execution failed for the shared data set 'Bids'.
Query execution failed for dataset 'DataSet1'
Invalid Synatx for Public. (Sales)
i'm not used to do SSRS report with a SSAS data conection so i dont really know what to do
Did i forgot something?
for addition here's the MDX code for the Bids dataset that we created in the Query Designer of SSRS
SELECT NON EMPTY { [Measures].[Error Count] }
ON COLUMNS,
NON EMPTY { ([Erroneous Bids].[Bid Link].[Bid Link].ALLMEMBERS
* [Erroneous Bids].[Bid].[Bid].ALLMEMBERS
* [Erroneous Bids].[Sales Line].[Sales Line].ALLMEMBERS
* [Erroneous Bids].[Probability].[Probability].ALLMEMBERS
* [Erroneous Bids].[Date].[Date].ALLMEMBERS
* [Erroneous Bids].[Bid Error].[Bid Error].ALLMEMBERS
* [Erroneous Bids].[Sales Manager].[Sales Manager].ALLMEMBERS
* [Erroneous Bids].[Severity].[Severity].ALLMEMBERS
* [Erroneous Bids].[SalesTeam].[SalesTeam].ALLMEMBERS
) }
DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_VALUE, MEMBER_UNIQUE_NAME
ON ROWS
FROM ( SELECT ( STRTOSET(#ErroneousBidsSalesTeam, CONSTRAINED) ) ON COLUMNS
FROM ( SELECT ( STRTOSET(#ErroneousBidsSalesManager, CONSTRAINED) ) ON COLUMNS
FROM [Model]))
CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
I want to find out if my rdl report excludes the CustomerIDs "1001", "FF" and "99998002", I don't know where and how it is defined in the report builder, but I can see the source code of the .rdl file has this select statement:
SELECT NON EMPTY {
[Measures]...
}
ON COLUMNS, NON EMPTY {
(
...
)
}
DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_VALUE, MEMBER_UNIQUE_NAME ON ROWS FROM
( SELECT ( -{ [Customer].[CustomerID].&[1001], [Customer].[CustomerID].&[99998002], [Customer].[CustomerID].&[FF] }
...
Which I think means it is excluding the CustomerIds, but I couldn't find any description of the syntax: " SELECT ( -{" online
The minus sign is shorthand for the keyword EXCEPT.
I wonder if there is a way to have one set of parms feed into another automatically? For example, DS1 has a year and month query parms, both visible. DS2 has an identical year and month query parms, hidden. Is there a way to have the parms from DS1 feed into the parms for DS2 instantly? So when the report is ran both DS1 and DS2 tables are filtered instantaneously?
I saw a similar post on this but the answer was not made clear. Below is my MDX:
SELECT NON EMPTY { [Measures].[OPEN],[Measures].[oYTDavg] } ON COLUMNS,
NON EMPTY { ([OpenWOs].[FY].[FY].allmembers * [OpenWOs].[FM].[FM].allmembers ) }
DIMENSION PROPERTIES member_caption, member_unique_name ON ROWS
FROM (
SELECT ( STRTOSET(#openwosfy, constrained) )
ON COLUMNS
FROM [Model])
CELL PROPERTIES VALUE,
back_color,
fore_color,
formatted_value,
format_string,
font_name,
font_size,
font_flags
The first set of parms are #CFY and #CFM. The second set are #OpenWOsFY and #OpenWOsFM.
I execute this query and gives me this error:
Infinite Recursion Detected: The loop of dependencies is: Direct Reporting->Direct Reporting.
Can anybody help me?
WITH
MEMBER [Measures].[Direct Reporting] AS COUNT([Employee].[Employees].Members, EXCLUDEEMPTY)
SELECT
{[Measures].[Direct Reporting]} ON COLUMNS,
{[Geography].[Country].AllMembers} ON ROWS
FROM [Adventure Works]
You've picked a special type of hierarchy: a parent/child hierarchy.
Here is an example of a count against the advWks cube:
WITH
MEMBER [Measures].[aCount] AS
Sum
(
(
[Customer].[Customer].[Customer]
,[Customer].[Customer Geography].CurrentMember
)
,IIF
(
[Measures].[Internet Order Quantity] > 50
,1
,0
)
)
SELECT
{
[Measures].[Direct Reporting]
,[Measures].[Internet Order Count]
} ON COLUMNS
,{[Customer].[Customer Geography].[Country].MEMBERS} ON ROWS
FROM [Adventure Works];
Specifying Count with EXCLUDEEMPTY means the engine needs to evaluate the cube's cells referenced by each member of the dimension and the current [Measures]. Not 100% sure about SSAS behavior but it seems the current [Measures] is the calc. measure being defined itself: hence the infinite loop.
To fix it, you can explicitly define the [Measures]:
WITH MEMBER [Measures].[Direct Reporting] AS
COUNT( { [Measures].[use-here-your-measure] } * [Employee].[Employees].Members, EXCLUDEEMPTY)
Or perhaps use the NonEmpty function:
AS Count( NonEmpty( [Employee].[Employees].Members,
[Measures].[use-here-your-measure] ))
Hope that helps.
Goal:
Filter the value in the table column based on string "Canada" as a criteria.
Problem:
I cannot get the MDX syntax code in where state to be correct in order to filter the data based on Canada.
Information:
This situation is a simplified sample and my request is to add filter criteria in the where state.
Data source is SSAS:s AdventureWorksDW2012
Code:
SELECT
{
[Measures].[Reseller Order Count],
[Measures].[Discount Amount]
} ON COLUMNS,
{
([Reseller].[Reseller Type].[Business Type].ALLMEMBERS )
} ON ROWS
FROM [Adventure Works]
WHERE
(
FILTER
(
[Geography].[Country].ALLMEMBERS, [Geography].[Country].NAME ='Canada'
)
)
There are two issues:
In Adventure Works, the Geography dimension is not linked to the Internet Sales measure group. Have a look at the cube definition, tab "Dimension Usage". You should use the hierarchies from the Customer dimension found in the Location folder when using measures from the Internet Sales measure group. I use [Customer].[Country] below.
In a filter, you should use Current and a set alias to refer to the current element during the iteration of the set.
The following shows what you want, I just changed the Filter:
SELECT
{
[Measures].[Reseller Order Count],
[Measures].[Discount Amount]
} ON COLUMNS,
{
([Reseller].[Reseller Type].[Business Type].ALLMEMBERS )
} ON ROWS
FROM [Adventure Works]
WHERE
(
FILTER
(
[Customer].[Country].ALLMEMBERS as c, c.current.NAME ='Canada'
)
)