Problem: What are spark lines
and How to create Spark lines in report using SSRS?
In Reporting Services reports, sparklines and data bars are
often used in tables and matrices. Their impact comes from viewing many of them
together and being able to quickly compare them one above the other, rather
than viewing them singly. They make it easy to see the outliers, the rows that
are not performing like the others. Although they are small, each sparkline
often represents multiple data points, often over time. Data bars can represent
multiple data points, but typically illustrate only one. Each sparkline
typically presents a single series. You cannot add a sparkline to a detail
group in a table. Because sparklines display aggregated data, they must go in a
cell associated with a group.
Sparklines and data bars have the same basic
chart elements of categories, series, and values, but they have no legend, axis
lines, labels, or tick marks.
If you want to know how to launch and create a basic report Create
a report SQL Server
Example:
In the example, I would like to show we can create a Spark report using SSDT.
Step 1: Drag a sparkline and choose a type of chart to
represent the data.
Step 2: Drag report dataset fields for numeric and
non-numeric data to the Chart Data pane of the chart. When you click the chart
on the design surface, the Chart Data pane appears, with three areas—Category
Groups, Series Groups, and Values.
In the dataset region I am using the following query which I
am going to use in the group by order counts year 2016.
/****** Script for SelectTopNRows command from SSMS ******/
SELECT count(Invoiceid)
, datename(month,(invoicedate))as month,
year(invoicedate) as year
FROM [DB].[dbo].[Invoice]
where year(invoicedate)=2016
group by datename(month,(invoicedate)),year(invoicedate)
order by MIN(month(invoicedate) )
Use the data set fields and drag those into sum portion to get the total counts and rows as months.
Output:
As we can see this can be used in the dashboard to show how the orders are fluctuating over the months.
0 comments:
Post a Comment