logo

Warning: The forum is now for consultation only. Please use GitHub Discussions to post any questions or comments.


Welcome Guest ! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
DharanGokul  
#1 Posted : Thursday, November 17, 2022 6:34:58 AM(UTC)
DharanGokul

Rank: Newbie

Groups: Registered
Joined: 4/7/2022(UTC)
Posts: 4
Man
India
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.
epf  
#2 Posted : Friday, November 18, 2022 7:34:49 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

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;
	}
}

DharanGokul  
#3 Posted : Tuesday, November 22, 2022 4:56:41 AM(UTC)
DharanGokul

Rank: Newbie

Groups: Registered
Joined: 4/7/2022(UTC)
Posts: 4
Man
India
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?
Users browsing this topic
Guest (2)
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.