Avg() Returns #Error in ReportViewer in c# - reportviewer2008

I have grouping of columns.
In Group footer i have this expression to give average of scores in that group.
=Avg(Fields!Score.Value)
When i run the report, Average column shows as #Error.
How can i resolve that.
Im using C# Winforms,VS2008
It shows warning as
Warning:The Value expression for the textbox ‘textbox55’ uses a numeric aggregate function on data that is not numeric. Numeric aggregate functions (Sum, Avg, StDev, Var, StDevP, and VarP) can only aggregate numeric data. (rsAggregateOfNonNumericData)
Initially i created table ,by setting Score as char(50). But now i changed in Database,Data type as Decimal for Score.
And also in reports, Dataset->perfscoretbl->Score->DataType as System.Decimal.
But still it shows as #Error.

I followed this link. It works fine now.Link

Related

Countifs function returns 0 in certain rows

I've recently started using Google Sheets for my new job and I need help with a little problem.
I created a function to compare a whole column of dates from a sheet with dates from another column on another sheet to filter the given count.
The code is as follows:
COUNTIFS('raw data'!$D$2:$D$952;">="&('2nd table'!$C$3:$C$52);'raw data'!$D$2:$D$952;">=01.08.2021";'raw data'!$D$2:$D$952;"<=31.08.2021")
raw data contains dates in column D. I've used 952 because that is the maximum range I can get. I've yet to solve how to implement this via named ranges.
2nd table contains the dates our employees started working at the company. I wanted to filter out the data that exists before their time at our company within raw data column D.
The function does return the correct value sometimes and sometimes it just returns 0.
If I boil down the function to just contain this:
=COUNTIFS('raw data'!$D$2:$D$952;">="&('2nd table'!$C$3:$C$52))
I get different values each time. I suspect that I cannot use the function in this way because the 2nd table got a different amount of rows to compare from.
How can I work around this issue if that's the problem and why does the function even work sometimes?

Pulling earliest date in specific criteria in google sheets

Using google sheets, I'm trying to pull the earliest dates for unique values using the query function.
The Raw data looks like this
I want to pull the data so that I only get the first test completed for each unique identifier provided that test was done within 2 days prior or after their ward admission. So it should spit out something like this:
The data range I need
I am using the following formula which is nearly what I want, it's just including multiple values for the unique identifers:
=Query(Sheet1!1:952,"Select A,B,C,D,E where C > -2 and C < 2 and C is not null and E is not null Order By D",1)
Results I'm getting with the above formula
I feel like I'm nearly there, I just need to somehow only pull the minimum date values instead of them all. Any help would be really appreciated!
It's actually easier to use Sortn with these than query (although you can choose the min value of any individual column (e.g. date) within a group using query, it doesn't give you the min value of any other columns corresponding to that min value, which is what you want). Sortn has an option to ignore rows that are duplicates with respect to a particular sort key or keys (in this case, Unique Identifier).
=sortn(sort(filter(A2:E,C2:C<2),4,1,1,1),999,2,4,1)
(if column C can be negative, put another condition in the filter).

Google Spreadsheet: Summing up a range by using numeric value in another cell

I'm an AP Biology student and am trying to create a mathematical model for a Hardy-Weinberg lab using Google Spreadsheet. Here is the link to the spreadsheet. The problem is located on the "Gene Flow" tab on N111.
So I am trying to add all the number values above N until it hits a certain number. That quantity of organisms is dependent on the total number of organisms AFTER the migration of Generation 1. And that migration is just random chance of whether some will leave or arrive. By adding up the new generation, I need to calculate the genotypes of their offspring (a.k.a. Generation 2), assuming there is 1:1 ratio between each generation.
Here is the code I tried:
=SUM(N6:N(SUM(F107:H107)+6))
However, the error I receive is Argument must be an range.
Is there a way to properly express this through Google Spreadsheet?
You could use the INDIRECT function. It returns a cell/range reference with only a string as input. For example:
=SUM(INDIRECT("N6:N"&(SUM(F107:H107)+6)))

Summing values in repeated sections in Orbeon

I have a problem when it comes to suming values from a repeated section. Specifically, when I have a repeated section in the orbeon builder with a control that has a value I can easily sum the values of these sections in a different control using sum($control-1) - in the calculated value. When inputing values in the form preview the sum is correct in my control with the summed value.
Unfortunately, when I add a section using the +Insert Below button in the form preview while testing the form the sum() function doesn't work anymore. In the control with this calculated value nothing is shown. Is there a different way to get the sum of values from repeated sections or is this a bug in orbeon?
Once you add a new section while testing the form the sum() function doesn't work anymore, because it adds a empty element to the node-set.
In XPath, when using the sum function, the value of each node is determined by trying to converting it to a number (number()), if there is a empty value, it's gonna convert to NaN, thus in the control with this calculated value nothing is shown by Orbeon.
A different way that would work would be to use the expression like: sum($control-1[text()]) . This way you are testing if the node has content before trying to sum it, so it's always gonna work.

Google Spreadsheet: Query String and Numeric (Involving math formula)

Sorry about the imprecise title. Allow me to elaborate. I'm currently in the process of making 'Order' sheets for the small retailer i work for. Some items are easy to count due to low inventory while other items are abundant and difficult to count but easy to gauge whether we ought to order them.
When an employee takes a store count, the on-hand number they put down is contrasted with a minimum. The minimum is our lower threshold. The minimum is subtracted by the input quantity and a formula produces a third column, "Order". If the number in the order column is < 0 then a query function on a separate sheet will copy the entire row. To be clear, there are three columns, "On Hand", "Minimum", "Order", with the "Order" column containing the following mathematical formula:
="Minimum" - "On Hand"
[Cells are specified so that it would look more like "=B2-A2".]
However, I'd also like to include the ability for employees to put a simple 'x' in the count spot, signifying that we need to order the product without having to count every single instance of the item. I'd still like to include the ability for them to enter a number if they so choose. I'd like for them to be able either the number or the 'x' in the same column. I'm currently using the following query function:
=QUERY('String(Fail)'!A:D;"select * where A contains 'x' or C > 0")
[The above is from a sheet I'm experimenting with. I will provide a link below in case you're more hands-on.]
The issue arises when the formula in the "order" column outputs any sort of number. If the formula is functional, no row marked with an 'x' is copied to the new page via the query command. If any row produces a numeric, no 'x' rows are copied over at all. I've experimented a bit but am at a loss as to where to go next.
The sheet I'm currently experimenting with is linked below. If you'd like any additional information I'd be happy to provide it. I'm relatively new to all of this so excuse my stupidity. I do recognize that I could very likely make a script for this but am not well versed in scripting with Google Apps and enjoy the immediate benefits of the query function.
Any help is welcome. Thank you.
Experimental Spreadsheet
All the values in a column need to be of the same type in order to be evaluated by QUERY. The mix of 'x' and numbers is confusing things.
If you use the Format menu to ensure all the values in column A are Plain Text, then your Query will work. (Formatting a numeric value as plain text does not stop it from working in a numeric calculation, so your column C survives.) Here's a screenshot of your query, after doing that formatting:
Based on your specification, your query needs to have the comparison to zero reversed, like this:
=QUERY('String(Fail)'!A:D;"select * where A contains 'x' or C < 0")
^^^

Resources