Invisible Attribute Hierarchy under Dimension - reporting-services

Below is the snippet of an mdx query used in a report.
with member [Measures].[Leased Coin In]
([Machine Dimension].[Leased Flag].&1 , [Measures].[Coin In])
Now, my question is:
In the cube under Machine Dimension, there is no attribute hierarchy name called Leased Flag.
I looked at in the xmla script, there is no such name. But, the mdx query pulls result out.
If it is hidden, why does not it appear in the xmla script as hidden/invisible or whatever it is?
If I m missing something, then how do I track it back to find out how it is related with the machine dimension.
Appreciate your help.

Have you tried running the query in SSMS? The &1 is not a valid identifier. Identifiers must start with an alpha character or be delimited with square brackets.
It is possible to write a calculated measure that references a non-existant hierarchy or member, but it would just return null. However a reference to &1 should not even get past the parsing stage of the query evaluation without throwing an error.

Old message but for those googling:
When you see something like [Dimension].[Hierarchy].&[1] (I'm assuming the [ ] around the 1 were just left out when entering the message) that is referring to the key of the member in the attribute as opposed to the caption of the member.
The typical place you see this is when using Dimension Security and looking on the Advanced tab or when choosing a Default Member. This lets you rename a member without breaking your cube logic.

Related

SSRS error - A scope is required for all aggregates Used outside of a data

I'm getting SSRS error - A scope is required for all aggregates Used outside of a data region unless the report contains exactly one data set.
I searched on google but still not figure out
= iif(((100/(DATEDIFF(MIN([initiative_Start_plan]),"InitiativeDatasettansiq"),
MAX([initiative_end_plan]),DAY))),"InitiativeDatasettansiq")
*DATEDIFF(TODAY(),MIN([initiative_start_plan]),DAY)/100*-1)>1,1,
(100/(DATEDIFF(MIN([initiative_start_plan]),"InitiativeDatasettansiq"),
MAX([initiative_end_plan]),DAY)))
*DATEDIFF(TODAY(),MIN([initiative_start_plan]),DAY)/100*-1),
"InitiativeDatasettansiq")
Your field references look incorrect. they should be something like
MIN(Fields!initiative_Start_plan.Value)
or
MIN(Fields!initiative_Start_plan.Value, "myDataSetOrGroupName")
The error is basically saying that you are using an expression outside of a data region and therefore you need to tell it where to get the data for each field from.
If this does not help then you'll need to show more info. You will need to show where your expression is going to be used so please show your report design including the names of datasets and/or row/column groups (if any).

How do you retrieve the result of a DCount expression from a related textbox for multiple records in a continuous form in MS Access?

Hello I have been trying to return the result of a DCount within an MS Access form. I have a field called "Process" which stores a process such as "Shipping" and Sub-Process field which stores text too e.g. "Engineering". I have another field which needs to store the count of how many shipping processes have a specific sub-process such as answering "how many sub-processes are there for each process?" called txtcountsubprocesses.
The related text field is saved as txtprocess and the count field (the one I can't seem to get right) has the name txtcountsubprocesses. In the Control Source property for txtcountsubprocesses I have the following expression:
=DCount([Sub Process],[LogisticsData],[Process]=txtprocess.text)
I receive the following error message: #Name?
I have tried multiple other ways of programming the DCount however the way mentioned above seems to be the closest I have to a possible answer. I have also checked the spelling of the table headers from [LogisticsData].
Is it possible to solve my problem using a DCount method like this?
Required output (sorry not sure how to put in a proper table):
Process ; Sub-process ; Sub-processCount (3 columns)
Shipping ; Engineering ; 5 (three pieces of related data - the number being what I need to produce)
Shipping ; Medical ; 4 (three pieces of related data - the number being what I need to produce)
Firstly, DCount needs string parameters to identify field and table name.
Secondly, if you want to include something from the current form, you can concatenate those strings, or use a form parameter.
Thirdly, you should almost never use .Text. Use .Value instead. You can only use .Text on controls that have focus.
So, with all these things fixed:
=DCount("[Sub Process]","[LogisticsData]","[Process]='" & txtprocess.Value & "'")
You might want to read into using parameters, since oddities might occur when the value is Null or contains single quotes

I have 3 parameters and I keep getting the forward dependencies are not valid error

The report parameter 'ServicePriorityNameParameter' has a DefaultValue
or a ValidValue that depends on the report parameter
"ServicePriorityNameParameter". Forward dependencies are not valid.
This is the error I keep receiving when trying to use this parameter.
I also have a WorkCategoryParameter which I specified the values for. Also a RequestNumberParameter in which a request number can be typed into.
I have tried reordering my parameters and also adding a separate dataset in which to run each parameter off of. I'm pretty new to SSRS so any words of advice will help. Thanks!
Reordering the parameters in the designer does not actually reorder them. If you open the report's rdl file (if using visual studio just right-click the report in the solution explorer and select View Code). In there, look for the ReportParameters section and reorder the parameters from there. Basically you need to make sure that any parameters that are dependent on other parameters are listed after the thing they are dependant on.
E.g. If you had a parameter called #Countries to list countries based on continent and the dataset that supplied the values to that parameter read something like SELECT * FROM dbo.MyCountryTable WHERE Continent = #continent then the #continent parameter would have to appear first in the list as #Countries depends on it.

Integrating a parameter inside a SSRS lookup expression?

I am attempting to control the visibility of an error message with the following code:
=IIf((Lookup(Parameters!FA.Value, Fields!fa_num.Value,Fields!LastName.Value,"Advisor_Numbers")=""),False, True)
What this theoretically should do is look at the FA # inputted by the user, then look within the "Advisor_Numbers" dataset for a match in fa_num...and once found to check if the last name of the advisor is empty.
If this is true: return false. Otherwise, return true.
This code always returns false despite the sample FA numbers I use existing in the Advisor_Numbers table. Is my syntax for writing a parameter within a lookup incorrect?
Ideally I'd just like to lookup if the parameter exists within the table without involving the last name.
I found the solution to my own problem.
While everything looked fine on the surface, there was probably some empty space somewhere in my data. Therefore, make sure to use Trim.
=IIf((Lookup(Trim(Parameters!FA.Value),Trim( Fields!fa_num.Value),Trim(Fields!LastName.Value),"Advisor_Numbers")=""),False, True)
The code above worked smoothly and solved all my issues

LookUp not matching properly

So, I have a problem in Report Builder that is just driving me absolutely crazy.
I have two dataset; one called DS_Grades and the other DS_Pupils. I want to do a simple LookUp based on PupilID, a field that is in both datasets, and return a grade from DS_Grades into a Matrix based on DS_Pupils.
The formula I am using is:
=LookUp(Fields!PupilID.Value, Fields!PupilID.Value, Fields!Grade.Value, "DS_Grades")
I have confirmed that:
1) DS_Grades has the right PupilIds
2) There are actually values in the Grades field
3) Both PupilID fields (I.E. in both datasets) are definitely Integers and not text.
Moreover, if I add a calculated field to DS_Grades called "test" and populated with the value 208301, which is a valid PupilID, then I can enter the below formula and it works fine:
=LookUp(208301, Fields!test.Value, Fields!Grade.Value, "DS_Grades")
So, the LookUp itself must be matching properly, which means that the PupilID fields must be causing the problem, but I have quintuple freaking checked them and they definitely have the right values, in the right format. I am at a total loss as to why SSRS thinks that they don't match.
Help please!
Got it! Some filtering was at Dataset Level (instead of query where I normally do it) that was throwing the whole thing out of joint. Removed that, and it's fine.