Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Chart

Author  Topic 

mikebird
Aged Yak Warrior

529 Posts

Posted - 2010-03-11 : 06:26:01
I have a chunky block chart with a query giving all +ve values and have added another dataset with -ve values below to 0 line. All date periods match up. What's the best way to do it?

How do you add a second dataset to a graph?

Thanks

mikebird
Aged Yak Warrior

529 Posts

Posted - 2010-03-11 : 09:01:04
No need for a second dataset. It all gets grouped in positive and negatively seperately in one query. How to show in one chrt? Look:

Select Period, SUM(Positive)
FRom (Select period, CASE SIGN(adjusted_total)
WHEN 1 THEN SUM(adjusted_total)
ELSE 0 END as Positive
From ECN_submitted
GRoup by period, adjusted_total) a
Group by Period


Union


Select Period, SUM(Negative) neg
FRom (Select period, CASE SIGN(adjusted_total)
WHEN -1 THEN SUM(adjusted_total)
ELSE 0 END as Negative
From ECN_submitted
GRoup by period, adjusted_total) a
Group by Period
Order by Period


Period (No column name)
200904 0
200904 2650216.85072123
200905 0
200905 4032462.62999999
200906 0
200906 3781073.43
200907 -3666509.76386477
200907 4599046.00494328
200908 -81905.1599999999
200908 3391998.91
200909 0
200909 5334596.87999999
200910 0
200910 4617094.56
200911 0
200911 3719311.52999999
200912 0
200912 4103609.11999999
201001 0
201001 4664465.03


all I get is the date group adding all values into one column? I KNOW you can tell me how to fix this - in the query, or a chart option!
Go to Top of Page
   

- Advertisement -