Pages

Sunday 17 June 2012

Alternating Table Row Color In SSRS Step by Step


Alternating Table Row Color  In SSRS Step by Step

Here is an example from AdventureWorks Database.


Sql Script.

SELECT TOP 1000 [StateProvinceID]
      ,[StateProvinceCode]
      ,[CountryRegionCode]
      ,[Name]
      ,[rowguid]
      ,[ModifiedDate]
  FROM [AdventureWorks].[Person].[StateProvince]

Select the Header Row of the table in the report.
Go to Properties Window.
 Under the BackgroundColor property, Select color from drop down.

Now, Select the Data Row of the table in the report.
Go to Properties Window.

Under the BackgroundColor property, select expression from the drop down.
Enter the expression "=IIF(RowNumber(Nothing) mod 2 = 0, "SeaGreen","Pink") " in the Expression Window.
Click OK.
Below is a Preview of a SSRS report with two different colors for alternate rows.






Saturday 2 June 2012

When should you use a Star and when should you use Snowflake Schema

Q: When should you use a Star and when should you use Snowflake Schema ?

Star Schema :  If the performance is the priority Than go for Star Schema, Since here dimension tables are denormalized.

Snowflake Schema : If memory space is the priority than go for Snowflake Schema, since here dimension tables are normalized.

Advantage and disadvantage of Snowflake Schema


Q: What are the Advantage and disadvantage of Snowflake Schema ?

Advantage of Snowflake Schema

  • The main advantage of Snowflake Schema is the improvement of query performance due to minimized disk storage requirements and joining smaller lookup tables.
  • It is easier to maintain.
  • Increase flexibility.


Disadvantage  of Snowflake Schema

  • The main disadvantage of the Snowflake Schema is the additional maintenance efforts needed to the increase number of lookup tables.
  • Makes the queries much more difficult to create because more tables need to be joined.

Snowflake Schema


Q : What is Snowflake Schema in SSAS ?

A Snowflake Schema contains fact table and dimension tables, with the fact table storing facts about business transactions  and some columns of the fact containing foreign key references to the dimension tables. The dimension tables of a snowflake schema are typically normalized to the third normal form (3 NF) or higher. As a result the data for a given dimension is spread out over multiple tables, and a diagram of the database resembles a snowflake.