Showing posts with label numbers. Show all posts
Showing posts with label numbers. Show all posts

Friday, March 23, 2012

R

I have a report where i crunch some numbers and show an overall market value for the top 10 particular segments. The question I have is if I have some data that has lets say the top market value as being 57% and so on, why does the pie chart show larger portion that 57%? Is it because im not showing all segments and only the top 10? Any way to make the chart more accurate in its representation of the 57%? Sorry if I havent explained this very well.anyone have any thoughts on this? i will assume its the nature in how the pie chart works, my question is how to get the pie chart to be more representative of the actual percentages|||

Are you using filters on the pie chart?

Rather than using percentage values could you convert them to real values out of 100?

You may want to look at Dundas software's charting solutions as they could be more flexible than the out-of-the-box charts.

cheers,

Andrew

sql

Tuesday, March 20, 2012

Quickie about virtual tables.

Will yukon be implementing anything like these 2 UDFS?
Select * from numbers (7, 9)
--
number
7
8
9
Select * from dates ('3-Mar-2001', '7-Mar-2001')
where date <> '6-Mar-2001'
order by date desc
--
date
7-Mar-2001 00:00:00.0
5-Mar-2001 00:00:00.0
4-Mar-2001 00:00:00.0
3-Mar-2001 00:00:00.0
It would be incredibly helpful lads. Thanks a lot.I do not know about it, but it could be implemented in 2000 using an
auxiliary numbers table.
Why should I consider using an auxiliary numbers table?
http://www.aspfaq.com/show.asp?id=2516
Example:
use northwind
go
select
identity(int, 0, 1) as number
into
dbo.number
from
sysobjects as a cross join sysobjects as b
go
alter table dbo.number
add constraint pk_number primary key clustered (number asc)
go
create function dbo.ufn_gen_numbers (
@.f int,
@.t int
)
returns table
as
return (select number from dbo.number where number between @.f and @.t)
go
create function dbo.ufn_gen_dates (
@.f datetime,
@.t datetime
)
returns table
as
return (select dateadd(day, number, @.f) as the_date from dbo.number where
number <= datediff(day, @.f, @.t))
go
select
number
from
dbo.ufn_gen_numbers(7, 9)
order by
number asc
select
*
from
dbo.ufn_gen_dates('20010303', '20010307')
order by
the_date desc
go
drop function dbo.ufn_gen_dates, dbo.ufn_gen_numbers
go
drop table dbo.number
go
AMB
"Ian" wrote:

> Will yukon be implementing anything like these 2 UDFS?
> Select * from numbers (7, 9)
> --
> number
> 7
> 8
> 9
> Select * from dates ('3-Mar-2001', '7-Mar-2001')
> where date <> '6-Mar-2001'
> order by date desc
> --
> date
> 7-Mar-2001 00:00:00.0
> 5-Mar-2001 00:00:00.0
> 4-Mar-2001 00:00:00.0
> 3-Mar-2001 00:00:00.0
> It would be incredibly helpful lads. Thanks a lot.
>|||You could do that today using a table-valued UDF. But why bother?
Auxiliary tables are a more efficient, more flexible and more portable
method to achieve the same thing.
David Portas
SQL Server MVP
--|||I agree, I could do it using tables, but frankly I'm not interested in
portability. A table that doesn't exist needs no I/O at all to perform
a loop join against it, if it's intrinsic to the server.|||I agree, and this is the way I've always done it. I was hoping though
that as it's such a powerful way for solving relational -> non
relational problems, that it would be created.
Also, no disk space is required either.