Selecting data for a single month in ssrs pie chart - sql

I have the following dataset for my ssrs report :
Year Month Sales1 Sales2
2013 3 29 299
2013 4 34 343
2013 5 43 322
2013 6 34 343
I need to create a pie chart with only one month of data and the month is selected using a parameter.
Example : If I select month 6 from the parameter .
I would like to show 34 and 343 within the pie chart.
I have looked at numerous tutorials and have been trying to do it since the past one hour but couldnt make
any progress.Any help is appreciated .

Filter it inside dataset properties. Here is a link
http://technet.microsoft.com/en-us/library/ms156270(v=sql.100).aspx
also here
http://technet.microsoft.com/en-us/library/aa337401(v=sql.105).aspx

Related

SSRS: Horizontal alignment on a group

On my dataset I select information from four different years sorted by date and how many subscriptions I had on said date, which looks something like this:
Date Year Subs Day
15/09/2014 2015 57 1
16/09/2014 2015 18 2
17/09/2014 2015 16 3
14/09/2015 2016 10 1
15/09/2015 2016 45 2
16/09/2015 2016 28 3
12/09/2016 2017 32 1
13/09/2016 2017 11 2
14/09/2016 2017 68 3
24/08/2017 2018 23 1
25/08/2017 2018 53 2
26/08/2017 2018 13 3
What I'm trying to do is create an 'Year' Column Group to align them horizontally, but when I do that, this is the result:
result
Expected result:
expected result
Is this achievable in SSRS? I've tried removing the group =(Details), which gives me the desired result, except it only returns one line of information.
Any insight aprreciated.
By default, the Details group causes you to get one row per row in the dataset. In your case, I would suggest grouping the Rows by the Day column and create a column group by Year.
First, create the two groups and add columns inside the column group.
Then, add a row outside and above the Day row group. Place the headings here and then delete the top row. It should look like this:
Now these 4 columns will repeat to the right for each year and you will get rows based on the number of days in your dataset.

MS Access - Dynamic Crosstab Query - VBA for Totals Row that provides Column totals

I have built a dynamic crosstab query where the user selects options from multiple combo boxes and then I use VBA to update the SQL for the cross tab query. It is then, in turn, displayed on a subform. My question is basically how can I programmatically (VBA or SQL, don't really care either way) add a totals row that calculates the average of each column. I know how to do this manually, but since the number of columns and column headings are not set, this is impractical. I would basically like to automatically set a totals row at the bottom for the average of each column regardless of the number of columns or column headers. An example of a potential case is shown below with the user inputs on top.
Group: A
Team: All
Start Date: 1/1/2014
End Date: 5/31/2014
Query Type: Monthly
Name 2014-Jan 2014-Feb 2014-Mar 2014-Apr 2014-May
John Doe1 1 2 3 4 5
John Doe2 2 2 2 2 2
John Doe3 1 5 9 13 17
John Doe4 2 10 18 26 34
John Doe5 1 8 15 22 29
John Doe6 2 12 22 32 42
John Doe7 1 15 29 43 57
John Doe8 2 14 26 38 50
John Doe9 1 12 23 34 45
Total (Avg): 1.44 8.89 16.33 23.78 31.22
I am trying the generate the bottom "Totals" row programmatically without knowing the column count ahead of time and without manually inserting totals via the ribbon.
You can use a pivot table on a simple select query.
Doesn't the crosstab query do that for you?
https://support.office.com/en-us/article/Make-summary-data-easier-to-read-by-using-a-crosstab-query-8465B89C-2FF2-4CC8-BA60-2CD8484667E8
http://www.fmsinc.com/microsoftAccess/query/crosstab-report/index.html
Although crosstab queries are somewhat limited in their power, you can certainly create another query to do a basic average of the crosstab query you just created.

Create DAX measure to get max sales from 2 specific years

I want to create a calculated measure that shows Max(Sales Year 2012, Sales Year 2013) for particular set of product. can we do this using the calculate function?
Prod 2010 2011 2012 2013
A 280 152 251 387
B 115 381 207 304
C 265 138 394 210
D 483 135 145 464
E 304 134 193 342
Sure, that's one of the benefits of using CALCULATE!
Here is the formula for MAX sales in 2013:
CALCULATE([SalesSum],Sales_New[Year] = 2013)
[SalesSum] represent just a sum of all sales and to make things a bit more organized, it's formula is very simple: SUM(Sales_New[Sales]).
Sales_New[Year] is the name of the column that includes years (see below for more details).
For 2012, simply change the filter in the second argument:
CALCULATE([SalesSum],Sales_New[Year] = 2012)
One important thing though -- I needed to transform your source data so that I can do all calculation need. I named the table Sales_new. Attached screenshot should explain everything.

How to programmatically layout days in a calendar in a way that matches the month and day of the week?

How can I do this?
I'm sure this has been done before. I've checked a couple of projects on github, such as calendar master, but they are all more complicated than what I need.
Oct 2013
S M T W T F S
30 1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31 1 2 3
Is there a best approach to do this? To layout days in a way that will match the day of the week for that month?
This will be made in a tableview, but I'm not looking for code, just the logic behind it. Unless there's a really good solution out there already.
Thank you!
The logic could be something like this (pseudo code):
get the weekday of the first day of the month in question
determine the number of days of the previous month
fill the first line
with leading final days of previous month, if any
the remaining days for the first week of the month in question
fill all other lines
fill the rest of the last line
with the first days of the following month, if any space left

Create a Multi-Column Report Using DevEx Grid

I have a daily sales report query and it have 2 columns like
days sales
1 12
2 65
3 25
...
30 24
but when I want to print it there is a lots of free spaces on paper, so I want to seperate query with a percentage (like % 33)
and result will be like 3 x 2 columns for one paper. and it will be more comfortable for me.
days sales days sales days sales
1 12 11 21 21 5
2 65 12 53 22 18
3 25 13 0
...
10 45 20 12 30 55
Any way to do this with DevEx Grid?
this is the view which I get
and I dont want such kind of empty paper for couple of records..
You will not find an easy way to achieve the desired result using XtraGrid, because it is not intended for reporting. I suggest that you create reports using another product: XtraReports.