Access Dynamic Chart - ms-access

I need to create a chart in Access that works with a drop down.
Meaning that I should be able to select the user from a dropdown to display only his chart: I do not want to write code for it.
WO User Diff
3044665 KEITH YASINCHUK 38
3045064 KEITH YASINCHUK 38
3045168 KEITH YASINCHUK 33
3045180 KEITH YASINCHUK 23
3045183 KEITH YASINCHUK 5
3045184 KEITH YASINCHUK 11
3045188 KEITH YASINCHUK 9
3045191 KEITH YASINCHUK 23
3045197 KEITH YASINCHUK 10

I assume you already have
a form with a combo box,
a report with the chart
a query to populate the chart.
In the query - add the user-id to the query column in the critera space.
use the format: Forms!formWithcCmboOnIt!nameOfCombo
then add a button to the form using a macro to open the report.

Related

MySQL Percentage Rank without the function

I am forced to create a percent rank on a number of columns in a database table and I am really struggling with this. Usually I would use the PERCENT_RANK function but I am forced to use conventional query as our MySQL version doesn't offer that function.
I have a table that contains the columns:
UID Total-Orders-Placed Last-Order-Date-Diff
12884 8 351
10985 11 106
30613 3 43
30820 2 134
23421 9 76
I would like to add 2 ranking columns as below:
UID Total-Orders-Placed Last-Order-Date-Diff rec_rank freq_rank
12884 8 351 0.34 0.86
10985 11 106 0.64 0.91
30613 3 43 0.85 0.59
30820 2 134 0.57 0.40
23421 9 76 0.77 0.88
In reality I have thousands of rows and additional columns but that's the gist. I have been able to do it perfectly in Excel but I am really struggling to convert into Query/Views in our MySQL Database so our data can be viewed realtime.
I have tried PERCENT_RANK() but as I mention above this function isn't available to us.
I have tried the queries discussed here without too much success yet: http://code.openark.org/blog/mysql/sql-ranking-without-self-join
Any help writing the code or to give me a better understanding of it would really help.

5 point average in SSRS

I try to put a 5 point avg in my chart. I add a trendline, but it looks like this:
And then I created a new series to calculate there the avg. and this looks like this:
but I would like to show this in a 5 point average. How can I do this?
This answer is based on my experience with Excel, not reporting services, but it is probably the same problem.
Your chart is probably a scatter plot rather than a line chart (note: this is Excel terminology). A scatter plot does not have an intrinsic ordering in the data. A line chart does.
The solution (for a scatter plot) is simply to sort the data by the x-values. The same will probably work for you. If you are pulling the data from a database, then order by can accomplish this. Otherwise, you can sort the data in the application.
Using this post as a starting point you can see that it is possible to calculate a moving average for a chart using the SQL query that pulls the data from the database.
For example, using this table in my database called mySalesTable
myDate sales myDate sales myDate sales
---------- ------ ---------- ------ ---------- ------
01/01/2015 456 16/01/2015 546 31/01/2015 658
02/01/2015 487 17/01/2015 12 01/02/2015 121
03/01/2015 245 18/01/2015 62 02/02/2015 654
04/01/2015 812 19/01/2015 516 03/02/2015 261
05/01/2015 333 20/01/2015 1 04/02/2015 892
06/01/2015 449 21/01/2015 65 05/02/2015 982
07/01/2015 827 22/01/2015 15 06/02/2015 218
08/01/2015 569 23/01/2015 656 07/02/2015 212
09/01/2015 538 24/01/2015 25 08/02/2015 312
10/01/2015 455 25/01/2015 549 09/02/2015 21
11/01/2015 458 26/01/2015 261
12/01/2015 542 27/01/2015 21
13/01/2015 549 28/01/2015 21
14/01/2015 432 29/01/2015 61
15/01/2015 685 30/01/2015 321
You can pull out this data, and create a Moving average based on the last 5 dates by using the following query for your dataset
SELECT mst.myDate, mst.sales, avg(mst_past.sales) AS moving_average
FROM mySalesTable mst
JOIN mySalesTable as mst_past
ON mst_past.myDate
BETWEEN DATEADD(D, -4, mst.myDate) AND mst.myDate
GROUP BY mst.myDate, mst.sales
ORDER BY mst.myDate ASC
This is effectively joining a sub-table for each row consisting of the previous 4 dates and the current date, and finds the average for these dates, outputting that as the column moving_average
You can then chart both these fields as normal, to give the following output (with the data table so you and see the actual calculated moving average)
Hopefully this will help you. Please let me know if you require further assistance

Add page break at Column Level in RDLC Report

I am stuck into a problem....
I am filling my Table with Dataset with FIXED rows but Dynamic Columns.
My Requirement is that I need to have a page break after 5 columns...
Eg:
Product Name 2003 2004 2005 2006 2007
Mobile 10 15 20 19 17
Laptop 55 2 3 17 10
Tablet 10 10 25 4 9
Similarly on next page , I should have
Product Name 2008 2009 2010 2011 2012
Mobile 50 5 2 19 25
Laptop 5 2 30 17 100
Tablet 10 10 25 4 19
I haven't got anyone's reply till now ... :-(
But my problem is solved :
I followed this link : http://blogs.msdn.com/b/chrishays/archive/2004/07/23/horizontaltables.aspx
Above link also hade the HorizontalTable.rdl attached...
I just adjusted my fields,Dataset and groupnames... It is working like charm...!!!!
Thanks Chris..!!!
Regards,
You could create secondary data source and use it to filter the main one - with one record per "page". So, you would create "wrapper" report where you push all the data, add table to it with single column where you would drop subreport where you only push data filtered by the values in the record of the secondary "wrapper" table.

MS Access pie charts - base query advice?

I have some data that I want to display in a chart:
Theme Type Count(Type)
Blah1 1 5
Blah1 2 5
Blah1 3 8
Blah2 1 1
Blah3 2 5
Blah3 3 10
Blah4 1 111
Blah4 2 222
Blah4 3 333
I want to display that query data in a Pie Chart, one chart for each theme with a section of pie for each Type (with the value of the count determining the size). Unfortunately my mind has gone blank. Everything I try does not appear correctly, some queries also require an repeated entry of the parameters but even if I do that it doesn't display correctly. I think I need to write another query to the format:
Theme Type1 Type2 Type3 Type4
Blah1 5 5 8 1
Blah2 1
Blah3 5 10
Blah4 111 222 333
Is that correct and does that make sense? If it isn't correct how else do I do it?
I haven't done charts before and I am struggling a bit - many thanks for any help.
Try to put your data in columns. This is what I did. You can see the selection I had when I inserted the pie chart:
For more charts you can either copy the data and just replace the last column with the numbers. Or you could also copy the inserted chart and change the source data (when you click on the pie part you see the source data in the worksheet - you can drag it to a new area).
I ended up creating a crosttab query to produce the data in the following format, as you suggest it needed to be in the similar column layout:
Theme Type1 Type2 Type3 Type4
Blah1 5 5 8 1
Blah2 1
Blah3 5 10
Blah4 111 222 333
I am relatively experienced with Access - just not charts unforunately!! Seems so simple :(

Conditional Sorting according to one value and then alphabetically

I have this group in a table. Where I need to display one value on the top and rest according to its alphabetical order.
Table
Column1 Value#1 Value#2
Alpha 12 26
Beta 65 745
Gamma 987 87
Pie 7 2
Non-Beta 132 426
Zeta 112 266
I want to sort it like this(Can anyone also tell me the real use of this other than Viewing Purpose)
Table
Column1 Value#1 Value#2
Non-Beta 132 426
Alpha 12 26
Beta 65 745
Gamma 987 87
Pie 7 2
Zeta 112 266
So the Non-Beta has to be displayed on the top and rest according to alphabetical order.
Edit
Thank you very much for the below reply Chris, Really appreciate and yes it works.
I have one more question from the over table format itself...How can I display it in the below format...
Table
Column1 Value#1 Value#2
Non-Beta 132 426
Alpha 12 26
Pie 7 2
Zeta 112 266
Total 263 720
Beta 65 745
Gamma 987 87
Total 1057 832
Thank you
Select the table, right-click the table handle, select Tablix Properties and select the Sorting tab. Press the Add button then click the fx button to open the expression editor. Enter the following expression:
=IIF(Fields!Column1.Value = "Non-Beta", "A" + Fields!Column1.Value, "B" + Fields!Column1.Value)
All we are doing is prefixing the special value field with something so it comes before the other fields.