Showing posts with label member. Show all posts
Showing posts with label member. Show all posts

Friday, March 30, 2012

Resolving an attribute member from a member property

What will be the fastest way to resolve an atttribute member from one of its member properties, e.g. the key value from the source database assuming that the attribute key uses the dimension surrogate key for its KeyColumn?

You can use the member properties Key0, Key1, ... KeyN. Each of theses represents one of the columns in the attributes key columns.

E.g.

select [Time By Day].[Years].Members dimension properties key0, key1 on 0
from budget

|||

This is not what I was asking. Consider the following key attribute and member properties

Product (attribute key)

- ProductOriginal Key (member property and/or attribute)

The question was how can I resolve the Product attribute by knowing the ProductOriginalKey member property?

|||

Since there is many-to-one relationship between related attributes, there are actually multiple products with the same ProductOrdinal. You can easily get the set of all Product attribute members which have certain ProductOrdinal value, by using

Exists(Product.Product.Product.MEMBERS, Product.ProductOrdinal.&[key_of_ordinal])

HTH,

Mosha (http://www.mosha.com/msolap)

|||Thank you. Unfortunately, Exists doesn't seem to work as an allowed set security filter with parent-child dimensions as I reported on connect with CTP2 SP2. Neither does crossjoining works (*). A bug perhaps? Meanwhile, any idea what works to crossjoin two sets to create an allowed set?|||Sorry - I didn't see you mentioning before that it was Parent-Child. Can you please give more concrete description of the structure of dimension, which attributes you are securing etc. Example from Adventure Works would be most appreciated.|||

The link in my previous post demonstrates how this can be reproduced with AW. Assuming the AdventureWorks sample cube:


1. Create a new role Reviewer
2. Create an allowed set on the Employee dimension (cube level) as follows:
Exists([Employee].[Employees].Members, [Employee].[Hire Year].&[1997])
3. Browse the cube under Reviewer by Employee. Notice that all employees are returned. In comparison, the following query returns only two employees and their supervisors (as it should).
select [Measures].[Reseller Sales Amount] on 0,
Exists([Employee].[Employees].Members, [Employee].[Hire Year].&[1997]) on 1
from [Adventure Works]


4. Trying [Employee].[Employees].Members * [Employee].[Hire Year].&[1997] throws an exception, as well as
Exists([Employee].[Employees].Members, [Employee].[Hire Year].&[1997], 'Reseller Sales')

|||

Well, since you are defining dimension security - there is no need to ever write Exists as expression of any allowed set. Dimension security will do Exists itself. So all you need to do is to define security on Hire Year attribute instead of trying to do it on Employees attribute. Simply specify [Employee].[Hire Year].&[1997] as expression for the Allowed Set on Hire Year attribute - and everything will work as you need.

HTH,

Mosha (http://www.mosha.com/msolap)

|||

This works! Thank you so much for your help. I'd appreciate it if you could answer one more question for me. Let's say that when the user slices by the Sales Territory Region attribute hierarchy of the Sales Territory dimension, I want the user to see only the regions serviced by the allowed employees only. Is the following allowed set expression the most efficient way to do so?

Exists([Sales Territory].[Sales Territory Region].[Sales Territory Region].Members, [Employee].[Hire Year].&[1997], 'Reseller Sales')

I understand that I cannot use [Employee].[Hire Year].Members since security polices are not applied yet so essentially I have no other choice but to carry the Employee filter to the other dimensions. I am just concerned that with large dimensions this may incur significant performance penalty.

|||Yes, I beleive this is the best way to do it.

Resolving an attribute member from a member property

What will be the fastest way to resolve an atttribute member from one of its member properties, e.g. the key value from the source database assuming that the attribute key uses the dimension surrogate key for its KeyColumn?

You can use the member properties Key0, Key1, ... KeyN. Each of theses represents one of the columns in the attributes key columns.

E.g.

select [Time By Day].[Years].Members dimension properties key0, key1 on 0
from budget

|||

This is not what I was asking. Consider the following key attribute and member properties

Product (attribute key)

- ProductOriginal Key (member property and/or attribute)

The question was how can I resolve the Product attribute by knowing the ProductOriginalKey member property?

|||

Since there is many-to-one relationship between related attributes, there are actually multiple products with the same ProductOrdinal. You can easily get the set of all Product attribute members which have certain ProductOrdinal value, by using

Exists(Product.Product.Product.MEMBERS, Product.ProductOrdinal.&[key_of_ordinal])

HTH,

Mosha (http://www.mosha.com/msolap)

|||Thank you. Unfortunately, Exists doesn't seem to work as an allowed set security filter with parent-child dimensions as I reported on connect with CTP2 SP2. Neither does crossjoining works (*). A bug perhaps? Meanwhile, any idea what works to crossjoin two sets to create an allowed set?|||Sorry - I didn't see you mentioning before that it was Parent-Child. Can you please give more concrete description of the structure of dimension, which attributes you are securing etc. Example from Adventure Works would be most appreciated.|||

The link in my previous post demonstrates how this can be reproduced with AW. Assuming the AdventureWorks sample cube:


1. Create a new role Reviewer
2. Create an allowed set on the Employee dimension (cube level) as follows:
Exists([Employee].[Employees].Members, [Employee].[Hire Year].&[1997])
3. Browse the cube under Reviewer by Employee. Notice that all employees are returned. In comparison, the following query returns only two employees and their supervisors (as it should).
select [Measures].[Reseller Sales Amount] on 0,
Exists([Employee].[Employees].Members, [Employee].[Hire Year].&[1997]) on 1
from [Adventure Works]


4. Trying [Employee].[Employees].Members * [Employee].[Hire Year].&[1997] throws an exception, as well as
Exists([Employee].[Employees].Members, [Employee].[Hire Year].&[1997], 'Reseller Sales')

|||

Well, since you are defining dimension security - there is no need to ever write Exists as expression of any allowed set. Dimension security will do Exists itself. So all you need to do is to define security on Hire Year attribute instead of trying to do it on Employees attribute. Simply specify [Employee].[Hire Year].&[1997] as expression for the Allowed Set on Hire Year attribute - and everything will work as you need.

HTH,

Mosha (http://www.mosha.com/msolap)

|||

This works! Thank you so much for your help. I'd appreciate it if you could answer one more question for me. Let's say that when the user slices by the Sales Territory Region attribute hierarchy of the Sales Territory dimension, I want the user to see only the regions serviced by the allowed employees only. Is the following allowed set expression the most efficient way to do so?

Exists([Sales Territory].[Sales Territory Region].[Sales Territory Region].Members, [Employee].[Hire Year].&[1997], 'Reseller Sales')

I understand that I cannot use [Employee].[Hire Year].Members since security polices are not applied yet so essentially I have no other choice but to carry the Employee filter to the other dimensions. I am just concerned that with large dimensions this may incur significant performance penalty.

|||Yes, I beleive this is the best way to do it.

Saturday, February 25, 2012

Repost: Calculated default parameters not visible in Web UI

Repost of a question / bug I reported one week ago. As I am an MSDN
universal member, I think I have the right of an MS employee answer.
I want to set report parameters to the first day of the previous month.
In order to do so, I calculate a parameter value by entering the
following into the Report Parameter Dialog (Default Values - Non
Queried): =New Date(Now.Year,Now.Month,1).AddMonths(-1)
This seems to work fine. But the Web UI doesn't display the standard
value if I go to Report Properties - Parameters. Instead, only a check
mark is displayed in the "Has default value" checkbox, the "default
value" textbox is empty. If I click on "apply", I get an error "a value
has to be supported".
If I type in the same calculation function again into the text box, I
get the exception "rsReportParameterTypeMismatch".
What I actually want to do: To create multiple linked reports with
differing calculated standard values, e.g. previous week, previous
month, previous day. If I can't change to calucation formula in the Web
UI interface, it seems there is no way of doing this.
Am I missing something here, or is that a bug? How can I accomplish this?
Thanks for any help
UrsHi, Urs
Please check the list of newsgroups which are supported as part of the MSDN
program at http://msdn.microsoft.com/newsgroups/managed/. This newsgroup
is not currently part of the program and hence posts here are no eligible
for our response commitment.
I hope this clarifies things for you
John Eikanger
Microsoft Developer Support
This posting is provided ?AS IS? with no warranties, and confers no rights.
--
| Date: Wed, 29 Sep 2004 12:18:28 +0200
| From: Urs Eichmann <ursli@.online.nospam>
| Subject: Repost: Calculated default parameters not visible in Web UI
| X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
|
| Repost of a question / bug I reported one week ago. As I am an MSDN
| universal member, I think I have the right of an MS employee answer.
|
| I want to set report parameters to the first day of the previous month.
| In order to do so, I calculate a parameter value by entering the
| following into the Report Parameter Dialog (Default Values - Non
| Queried): =New Date(Now.Year,Now.Month,1).AddMonths(-1)
|
| This seems to work fine. But the Web UI doesn't display the standard
| value if I go to Report Properties - Parameters. Instead, only a check
| mark is displayed in the "Has default value" checkbox, the "default
| value" textbox is empty. If I click on "apply", I get an error "a value
| has to be supported".
|
| If I type in the same calculation function again into the text box, I
| get the exception "rsReportParameterTypeMismatch".
|
| What I actually want to do: To create multiple linked reports with
| differing calculated standard values, e.g. previous week, previous
| month, previous day. If I can't change to calucation formula in the Web
| UI interface, it seems there is no way of doing this.
|
| Am I missing something here, or is that a bug? How can I accomplish this?
|
| Thanks for any help
| Urs
|

Tuesday, February 21, 2012

ReportViewer1.SetQueryParameter getting message not a member of reportviewer

I am using the reportviewer control in vs2003 accessing the rs2005.

I get the message setqueryparameter is not a member and also i do

****************************************************************

PrivateSub populateReportViewer()

ReportViewer1.ServerUrl = "http://localhost/ReportServer"

ReportViewer1.ReportPath = "/SampleReports/Product Line Sales"

ReportViewer1.SetQueryParameter("ProductCategory", CategoryDropDown.SelectedValue)

ReportViewer1.SetQueryParameter("ProductSubCategory", SubCategoryDropDown.SelectedValue)

ReportViewer1.SetQueryParameter("StartDate", StartDate.Text)

ReportViewer1.SetQueryParameter("EndDate", EndDate.Text)

ReportViewer1.Parameters = Microsoft.Samples.ReportingServices.ReportViewer.multiState.False

ReportViewer1.Format = "HTML4.0"

EndSub

PublicSub SetQueryParameter(ByVal ParamName AsString, ByVal ParamValue AsString)

SetParameter(ParamName, ParamValue)

EndSub

***************************************************************************************

Please can someone provide me a sample code how to use the reportviewer control to call a report via storedproc with parameters.

Please help thank you very much for the information.

see this page : http://www.codeproject.com/aspnet/Reporting_Services.asp

Hope this will help

ReportViewer1.SetQueryParameter getting message not a member of reportviewer

I am using the reportviewer control in vs2003 accessing the rs2005.

I get the message setqueryparameter is not a member and also i do

****************************************************************

Private Sub populateReportViewer()

ReportViewer1.ServerUrl = "http://localhost/ReportServer"

ReportViewer1.ReportPath = "/SampleReports/Product Line Sales"

ReportViewer1.SetQueryParameter("ProductCategory", CategoryDropDown.SelectedValue)

ReportViewer1.SetQueryParameter("ProductSubCategory", SubCategoryDropDown.SelectedValue)

ReportViewer1.SetQueryParameter("StartDate", StartDate.Text)

ReportViewer1.SetQueryParameter("EndDate", EndDate.Text)

ReportViewer1.Parameters = Microsoft.Samples.ReportingServices.ReportViewer.multiState.False

ReportViewer1.Format = "HTML4.0"

End Sub

Public Sub SetQueryParameter(ByVal ParamName As String, ByVal ParamValue As String)

SetParameter(ParamName, ParamValue)

End Sub

***************************************************************************************

Please can someone provide me a sample code how to use the reportviewer control to call a report via storedproc with parameters.

Please help thank you very much for the information.

see this page : http://www.codeproject.com/aspnet/Reporting_Services.asp

Hope this will help