Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to calculated column in DB or SSRS

When we have some calculated column in database for reports, which is best way to calculated it's value in case of SSRS report development.

  1. Calculate it in SSRS tablix
  2. Calculate it from database and return as dataset

If I am duplicating this question then sorry for that, but I didn't got proper answer while googling.

like image 279
vishaldk Avatar asked Feb 14 '14 13:02

vishaldk


People also ask

When a calculated column is used in a database?

A computed column is a virtual column that is not physically stored in the table, unless the column is marked PERSISTED. A computed column expression can use data from other columns to calculate a value for the column to which it belongs.

How do I sum a calculated column in SQL Server?

The aggregate function SUM is ideal for computing the sum of a column's values. This function is used in a SELECT statement and takes the name of the column whose values you want to sum. If you do not specify any other columns in the SELECT statement, then the sum will be calculated for all records in the table.

Which of the following Designer is used to create calculated columns?

Calculated columns can only be created by using the model designer in Data View. In the model designer, click the DimDate table (tab).


1 Answers

Basically, it depends.

  • If the calculated value is fairly static then this favours a persisted computed column.
  • If the calculated value is useful in multiple reports, then this favours the computed column
  • If the report server and the reporting database are on the same SQL Server it may be a wash in terms of load,
  • If the report db is on an OLTP server but the report server is on a different instance it favour the the tablix to move the load.
  • There may also be a consideration for the nature of the calculation itself. Some may be more natural for one or the other.

I'm probably missing some, but the point is I don't believe that there is single right answer to the question.

like image 154
Karl Kieninger Avatar answered Sep 22 '22 22:09

Karl Kieninger