I have the following data table format generated from SQL. Users can select which car models to be populated in the graph. There will be different number of Car models appearing in different reports. So there will be variable number of line charts appearing in the graph.(One line for one car model series)
Jan Feb Mar Apr May Jun
Honda 12 17 24 18 30 13
Toyota 15 20 10 15 30 40
Yamaha 30 25 30 15 13 40
Suzuki 35 15 13 40 45 45
Nissan 15 35 40 40 50 50
Kia 13 21 23 15 25 30
Mazda 25 25 30 32 15 40
How can I create a graph like this with RDLC reports?
This can be easily done using series groups in rdlc charting. The chart data source should be structured like this.
Brand Month Value
Honda Jan 10
Honda Feb 15
Honda Mar 20
Toyota Jan 20
Toyota Feb 21
Toyota Mar 22
Yamaha Jan 10
Yamaha Feb 11
Yamaha Mar 12
Add "Value" column as chart Values.
Add "Month" column as chart Categories.
Add "Brand" column as chartSeries Groups.
Related
I have a table called "ticketManager" in my mssql. There were some expenses missing for "ABC" and I got monthly expenses. I want to divide it equally base on the count of Signed_Date.
Event_ID Name ticket Revenue Expences expect Signed_Date
G-00001 ABC 671 6720 0 50 01 June 2021
G-00002 CSA 5 56 18 100 05 June 2021
G-00003 CSA 5 78 38 100 03 June 2021
G-00004 VSX 23 34 23 NaN 03 June 2021
G-00005 ABC 4 89 0 40 02 June 2021
G-00006 ABC 60 73 0 60 15 April 2021
G-00007 CSA 60 345 110 60 12 June 2021
G-00008 ABC 89 890 NaN NaN 02 June 2021
G-00009 VSX 0 0 0 50 30 April 2021
G-00010 CSA 6 45 16 60 22 June 2021
G-00011 VSX 3 39 23 30 10 June 2021
G-00012 ABC 2 34 0 20 03 June 2021
G-00013 VSX 4 89 48 40 12 June 2021
G-00014 VSX 32 127 35 10 24 April 2021
G-00015 ABC 3 84 0 120 21 April 2021
G-00016 ABC 1 100 0 140 7 June 2021
G-00017 CSA 23 525 90 02 April 2021
for example, in June I have 5 records for ABC and I have expenses as 750.00. So I want to place 150 (750/5) for each record same as for April I have expenses as 110 and have 2 records. So want to place 55 for each record in ABC.
So the table looks like below.
Event_ID Name ticket Revenue Expences expect Signed_Date
G-00001 ABC 671 6720 150 50 01 June 2021
G-00002 CSA 5 56 18 100 05 June 2021
G-00003 CSA 5 78 38 100 03 June 2021
G-00004 VSX 23 34 23 NaN 03 June 2021
G-00005 ABC 4 89 150 40 02 June 2021
G-00006 ABC 60 73 55 60 15 April 2021
G-00007 CSA 60 345 110 60 12 June 2021
G-00008 ABC 89 890 150 NaN 02 June 2021
G-00009 VSX 0 0 0 50 30 April 2021
G-00010 CSA 6 45 16 60 22 June 2021
G-00011 VSX 3 39 23 30 10 June 2021
G-00012 ABC 2 34 150 20 03 June 2021
G-00013 VSX 4 89 48 40 12 June 2021
G-00014 VSX 32 127 35 10 24 April 2021
G-00015 ABC 3 84 55 120 21 April 2021
G-00016 ABC 1 100 150 140 7 June 2021
G-00017 CSA 23 525 90 02 April 2021
I have like million reords like that and have 5 years woth of records. What would be the efficience way to do that?
Thanks in advance.
You can use a window function:
SELECT t.*, avg(Expences) over (partition by extract(year_month from Signed_Date))
FROM ticketManager t;
I am trying to find the month-wise data for multiple years in Sequelize.js
For eg.Stardate:2016-01-01 and EndDate:2017-02-29.
table1
date pack_price
2016-01-01 30
2016-02-19 30
2016-03-14 20
2016-10-01 50
2017-01-28 100
2017-02-25 29
Expected Answer:
date pack_price
Jan 2016 30
Feb 2016 30
Mar 2016 20
Oct 2016 50
Jan 2017 100
Feb 2017 29
Actual Answer
Date Pack_price
Jan 2016 130
Feb 2016 59
Mar 2016 20
Oct 2016 50
Node js code using Sequelize.js
Utils.table1.findAll({
where:{
tran_date: {
[Op.gt]: startTime,
[Op.lt]: endTime
}
},
attributes: [[Sequelize.fn('sum', Sequelize.col('pack_price')),'total'],[Sequelize.fn('month', Sequelize.col('tran_date')),'Month']],
group:[[Sequelize.fn('month', Sequelize.col('tran_date'))]],
raw: true,
}).then(total=>{
Utils.sendResponse(1, total, "success", q)
})
However, this works well for one year.Should work for multiple years.Do you have any idea how I could make this happen?.Thanks in advance.
Please i need help to calculate moving average in SSRS. see example from excel bellow. i have search net and looked at other forum without success.
the moving average is something like Avg(A1:A3),Avg(A2:A4),Avg(A3:A5)etc
Count of ID BAND
-20 >20 <12 Grand Total Three Months Avg
Year Month <15 15-20 >20 Total
2012/2013 Jan 35 9 13 57 57
Feb 34 23 20 77 67
Mar 25 33 8 66 =AVERAGE(F5:F7)
Apr 7 31 13 51 65
May 6 10 13 29 49
Jun 19 14 18 51 44
Jul 34 16 6 56 45
Aug 26 21 30 77 =AVERAGE(F10:F12)
Sep 13 53 21 =AVERAGE(F11:F13)
Oct 1 34 33 68 =AVERAGE(F12:F14)
Nov 35 16 19 70 53
Dec 33 23 36 92 77
i have a report with parameter is the year i can select a multiple value
year
Data 2010 2011 2012
hp 14 25 30
Dell 17 18 20
what i need when i create the report i want to have another column with the last value concatenation with the last previous one like this :
year
Data 2010 2011 2012 2012/2011
hp 14 25 30 3025
Dell 17 18 20 2018
i tried this :
=Last(Field!Qte.value)+Last(Field!Qte.value)-1
but i had the wrong result i got this result :
year
Data 2010 2011 2012 2012/2011
hp 14 25 30 3029
Dell 17 18 20 2019
the problem is in this function
Last(Field!Qte.value)-1
it doesn't return the last previous value
I have two mysql tables
suppose table one name 'marks'
no A B C D
1 10 05 01 04
2 08 07 10 05
3 09 05 07 10
4 07 05 04 10
5 04 07 06 09
6 05 09 07 07
7 09 05 10 06
8 09 06 06 08
9 08 06 10 07
10 08 07 04 06
suppose table two name 'results'
in second table I want to put total marks and average marks based on above table.(import data from 'marks' table,process it and save it in 'results' table)
So once it filled it must be like this.
I want add column A,B,C,D in 'marks' table and put total value in column 'Total' in table 'results' and average by dividing 'Total' column by 4.
no Total Average
1 20 5.00
2 30 7.50
3 31 7.75
4 26 6.50
5 26 6.50
6 28 7.00
7 30 7.50
8 29 7.25
9 31 7.75
10 25 6.25
So how can I fill the 'result' table using mysql query?
Is it possible to do in mysql?
Thank you
Try something like:
INSERT INTO result (no, total, average)
SELECT no, A+B+C+D, (A+B+C+D)/4
FROM marks