Detail keeps changing to measure in webi report - business-objects

​Hi,
Im trying to add a detail object into a report based on two merged queries, however when I make it, it changes to a measure, resulting in a context error. The formula I have in the variable is as follows:
=Sum([Revenue/Costs].[Rated Amount]) Where ([Revenue/Costs].[Tracking ID] InList ("Connection"))
Is the Sum forcing the variable to change from a detail to a measure? I need to use the sum but I also need it to be a detail object rather than a measure, any ideas how to work around this?
Thanks

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 to get the grand total in main form from subform

This is the screenshot of how the final output should look.
However, in the screenshot you will find that purchase total (calculated text label) is the sum total of the first order description Total (calculated at form level): Final Form view section display
The above screenshot result is the output of this formula
=[OrderDescription_tbl].[Form]![Total]
If I use this formula
=Sum([OrderDescription_tbl].[Form]![Total])
The output is #Error.
Troubleshooting I did,
I had created a grand total at the footer of the Subform using
the Sum function and visible parameter set to No and wanted to
reference the output to the Main form Purchase total. How to solve this problem?
However, in the screenshot you will see the number of boxes
count (Not calculated and is a table column), I used the same Sum()
function in the order_description subform. It gives the correct
output. Why is there a difference in output for the same function
one, against the Non-calculated table column and the other, a calculated form text label?
I have used this formula too
=IIf([OrderDescription_tbl].[Form]![Total]>0,Sum([OrderDescription_tbl].[Form]![Total]),0)
Output is still #Error
I have used an query which calculates sum total of each line item and tried to reference this query as
a)=Sum([Query1]![Expr1]) received #Error
b)[Query1]![Expr1] received #Name?
As an alternative to the DSum solution proposed by Kostas, you can use the following workaround:
in the footer of the subform, insert a textBox with the =Sum([Total]) formula, name the textBox BigTotal (or whatever you want)
in the main form, refer to that control: =mySubFormControl.Form!BigTotal
make the subform's footer hidden if you want.
If you have large data sets, this should be faster than the DSum. Also if the subform has an embedded query as its recordSource, you avoid the creation of a queryDef.
Try the DSum() function:
=DSum("[Total]",[OrderDescription_tbl].[Form].[RecordSource])
Thanks! I have been able to solve it using the existing structure only. In this regard I referenced Northwind database.Although,my database would have been more specific and different from Northwind,some aspects from Northwind did give me hints on what to change. The trick was - I had several lookups fixed on numerical columns like unit_rate(and this unit_rate referred a product portfolio table containing product offering of our company).Once, I removed the lookup aspect of these column values, #Error as well as Name? error were automatically resolved. I created a grand total with Visible parameter set to No inside the order description subform and referenced the output of this form to the grand_total text label in the outer form as seen in the screenshots shared.😀 Thank you for the support#Ren Kessler and I will share this is Stackoverflow too so that others can take advice from my case scenario. Ren Kessler I will use your method in some other way,may be in this development scenario but for some other context. I found it quite interesting and I havent tried it. Apart from my reply, I would like to quote you and your solution method too.Total_Calculation_subforminternal_view_Expression_builder_for_grandtotal_textlabel
This is the solution Given by Ren Kessler(Facebook group member):" I solved it in a very convoluted way. I hope someone has a better solution than mine.
I created a series of fields on my form (not fields in a table, but just on the form) that reference the fields on the subform. Then I performed all my math using these form fields. It was the easiest way I could find.
It seems clumsy, but works. As well, it made it easy to use these fields on a report (in my case, an invoice).
In previous versions I did not have to do this. I took a 2002 app where the math worked on the sub form, and used the exact same steps in 2016 and got #error, just like you. This system solved it, but it just doesn't seem right."

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.

how to find sum of time difference using subtotaling in jasper's ireport

I have created a report in jasper ireport which will find idletime of production machines. am getting the output for that. But facing problem when trying to find total idletime.I have used subtotaling concept where i created a variable 'total' passed the idletime expression 'TimeDiff(startTime,stopTime)' ,also created a textbox and called the variable in that. In the preview instead of sum Iam getting only last value (idletime) of the table.
Please help me.
By default the calculation type of the variable will be set to Nothing. This will cause the variable to be overwritten with a new value for each record in the dataset. If this is the case, when you read the variable at the end of the report it will be equal to the last value from your set of data. This sounds like what is happening in your case.
To solve this you should set the Calculation property of your variable to Sum. This will add each new value to the existing one instead of overwriting it.

How to reference in SSRS report (in client mode) objects from application

I have a report created in SSRS in client mode, which is run disconnected: I create the data source in code and pass to the report as a DataView. It works ok.
But I need to be able to reference from the project to some objects (variables, whatever) from my application, as follows:
I need some totals that are not calculated based on data in report. e.g. the reports show total sales in a period, with own total, but I need to display a field in report footer - previous month total (actually they are about 10 other "previous" totals).
I need to have some columns show / hide based on some settings in the application (e.g. I have application option : Show Previous month sales)
Any thoughts on how to do this?
Thank you
Q1-> In order to use data in your reports, you need to specify the data inside of a Datasource object. You cannot simply use the variables if that is what your intentions were. So yes, you are doing this the right way. *** Sorry, you could theoretically used Report Parameters for this.
Q2-> This is the real reason to use Report Parameters. You can pass parameters to the report to do exactly this. If the HideColumn parameter (for example) is set to true, you could hide all the columns that need to be hidden.
http://msdn.microsoft.com/en-us/library/ms251750%28VS.80%29.aspx
For question 1 - the data - the easiest approach would be to create a DataTable in memory and add it as another dataset OR to add fields for your original dataview that contain these values.
Question 2 - To hide or show the columns based on settings make the column visibility an expression based on the value of a parameter, in your code behind set the parameter value to your application setting.