Totals - ignore NULL values
Totals - ignore NULL values
Hello,
I have data table with some NULL in some of the rows.
I am trying to compute Totals.Min value over a column, but I am getting a 0 as the min and I suppose that this is because of the NULL values.
Is there a way to exlcude the NULLs from computation of the MIN. Such as there is for SumIf and CountIf?
The same question goes for Avg I guess.
Thank you!
I have data table with some NULL in some of the rows.
I am trying to compute Totals.Min value over a column, but I am getting a 0 as the min and I suppose that this is because of the NULL values.
Is there a way to exlcude the NULLs from computation of the MIN. Such as there is for SumIf and CountIf?
The same question goes for Avg I guess.
Thank you!
Re: Totals - ignore NULL values
Hello,
Please check the last prerelease build.
If the issue still exist please send us a sample report with test data which reproduces the issue for analysis.
Thank you.
Please check the last prerelease build.
If the issue still exist please send us a sample report with test data which reproduces the issue for analysis.
Thank you.
Re: Totals - ignore NULL values
Thank you for your quick answer.
The problem happens in the latest release also.
The exact scenario is the following: a column of positive values having the first element (at row[0]) NULL. The element on the first row is NULL.
With all the other values being greater than 0, the Min is always zero.
Value
------
NULL
12
134
11
If I put a value (non null value) on the first row, then the Min is computed correctly.
Note: I am adding the formula in code behind as below:
The problem happens in the latest release also.
The exact scenario is the following: a column of positive values having the first element (at row[0]) NULL. The element on the first row is NULL.
With all the other values being greater than 0, the Min is always zero.
Value
------
NULL
12
134
11
If I put a value (non null value) on the first row, then the Min is computed correctly.
Note: I am adding the formula in code behind as below:
Code: Select all
report.RegData(tblDR.TableName, tblDR);
report.Dictionary.Synchronize();
report.CalculationMode = StiCalculationMode.Compilation;
StiTable table = new StiTable();
StiTableCell minCell = table.Components[nMinCellIdx] as StiTableCell;
string sMinExpresion = String.Format("{{ Totals.Min({0},{0}.{1}) }}", tblDR.TableName, Stimulsoft.Report.CodeDom.StiCodeDomSerializator.ReplaceSymbols(column.ColumnName));
minCell.Text.Value = sMinExpresion;
Re: Totals - ignore NULL values
Can anyone suggest a work around for this please?
Re: Totals - ignore NULL values
Hello,
Please try to set the ConvertNulls property for the report to false.
Thank you.
Please try to set the ConvertNulls property for the report to false.
Thank you.
Re: Totals - ignore NULL values
Hi,
I've tried ConvertNulls = false, but no help. The issue still remains.
Thank you
I've tried ConvertNulls = false, but no help. The issue still remains.
Thank you
Re: Totals - ignore NULL values
Looking inside with reflector:
It looks like the Stimulsoft.Report.Dictionary.StiMinDecimalFunctionService.Init() either never gets called or it gets called but never gets to initialize the minimum for the first time due to not meeting the conditions:
Please note that I am adding all data sources and table to page dynamically from code behind.
What do you think?
It looks like the Stimulsoft.Report.Dictionary.StiMinDecimalFunctionService.Init() either never gets called or it gets called but never gets to initialize the minimum for the first time due to not meeting the conditions:
Code: Select all
public override void Init()
{
if (!base.RunningTotal || base.IsFirstInit)
{
this.minimum = 79228162514264337593543950335M;
}
}
What do you think?
Re: Totals - ignore NULL values
Hello,
Please send us a sample report with test data which reproduces the issue for analysis.
Thank you.
Please send us a sample report with test data which reproduces the issue for analysis.
Thank you.