Seal Report Forum
»
Report Edition
»
Reports
»
How to calculate the median calculation?
Rank: Newbie
Groups: Registered
Joined: 4/7/2022(UTC) Posts: 4 Location: Erode Thanks: 1 times
|
Hello all, I had created the table Minimum, Maximum, and Average values are displayed, But I need to calculate the Median calculation. Please, anyone, know solve this problem.
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/20/2013(UTC) Posts: 1,209 Thanks: 14 times Was thanked: 206 time(s) in 199 post(s)
|
First try to rely on your database: try to create a column that makes the job. This may depends on your database engine. Otherwise you can reprocess calculation for a cell using the 'Cell Script' or using Tasks. Example of a cell script (select an element in your model, then edit the 'Cell Script' property): Code:@{
//Calculate a progression
ResultCell cell=Model;
ReportElement element = cell.Element;
ReportModel reportModel = element.Model;
Report report = reportModel.Report;
if (cell.IsSerie && cell.ContextRow > 0 && cell.ContextCol == -1)
{
//For serie, ContextRow and ContextCol is the common row and col used for the dimension values
//In this case, we use the values of the Total (column before last)
var colIndex = cell.ContextCurrentLine.Length - 3;
var previousValue = cell.ContextTable[cell.ContextRow-1,colIndex].DoubleValue;
var currentValue = cell.ContextTable[cell.ContextRow,colIndex].DoubleValue;
//Calculate the progression
cell.Value = (currentValue - previousValue)/previousValue;
}
else if (cell.ContextRow == cell.ContextTable.RowCount - 1)
{
//No progression for last table line (summary or data)
cell.Value = null;
}
else if (!cell.IsTitle && cell.ContextRow > 0)
{
//Normal case for DataTable and SummaryTable
var previousValue = cell.ContextTable[cell.ContextRow-1,cell.ContextCol-1].DoubleValue;
var currentValue = cell.ContextTable[cell.ContextRow,cell.ContextCol-1].DoubleValue;
cell.Value = 100*(currentValue - previousValue)/previousValue;
}
}
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 4/7/2022(UTC) Posts: 4 Location: Erode Thanks: 1 times
|
I couldn't understand how to do that in the seal report. i had already created the min and max values in a table view. i but i can't get the Median value with restriction. if i get the median values it shows overall column median values if i restrict the values that show only overall values. can you please share any example report that will be helpful to me?
|
|
|
|
Seal Report Forum
»
Report Edition
»
Reports
»
How to calculate the median calculation?
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.