I have a chart in a Report Viewer control:
我在Report Viewer控件中有一个图表:
Series data is a sum:
系列数据是一个总和:
Problem How to make the Redemptions axis into a percentage? eg 5am has 45% of the total redemptions for that day
问题如何将赎回轴转换为百分比?例如,凌晨5点有当天总兑换的45%
1 个解决方案
#1
0
without seeing your data, i'm going to guess that you'll probably have to do an aggregate of each day's Redemtpions, then join that to each time period.
在没有看到你的数据的情况下,我猜你可能需要对每天的Redemtpions进行汇总,然后将其加入到每个时间段。
so, without knowing your data or anything, here's an example:
所以,在不知道你的数据或任何东西的情况下,这是一个例子:
;with dayavg as
(
select day, count(*) as NumberRedemptionsDay
from dbo.Redepmtions
group by day
),
houravg as
(
select day, hour, count(*) as NumberRedeptionsHour
from dbo.Redemptions
group by day, hour
)
select
houravg.hour,
houravg.NumberRedeptionsHour,
(houravg.NumberRedeptionsHour/NumberRedemptionsDay)*100 as Perc
from houravg
inner join dayavg
on houravg.day=dayavg.day
#1
0
without seeing your data, i'm going to guess that you'll probably have to do an aggregate of each day's Redemtpions, then join that to each time period.
在没有看到你的数据的情况下,我猜你可能需要对每天的Redemtpions进行汇总,然后将其加入到每个时间段。
so, without knowing your data or anything, here's an example:
所以,在不知道你的数据或任何东西的情况下,这是一个例子:
;with dayavg as
(
select day, count(*) as NumberRedemptionsDay
from dbo.Redepmtions
group by day
),
houravg as
(
select day, hour, count(*) as NumberRedeptionsHour
from dbo.Redemptions
group by day, hour
)
select
houravg.hour,
houravg.NumberRedeptionsHour,
(houravg.NumberRedeptionsHour/NumberRedemptionsDay)*100 as Perc
from houravg
inner join dayavg
on houravg.day=dayavg.day