SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
3,040 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I need to show a chart like this:
Can I show it with this data:
Name Count
ABC 30
where green is 30% and black is 70% to make it 100%.
Thanks.
One way is to calculate the rest up to 100 already in the SQL query.
Imagine "test" is your table with the figures, then this should work.
;with test as
(select 'ABC' AS Name, 30 AS Cnt)
SELECT *
FROM test
UNION ALL
-- Calculate the rest up to 100
SELECT 'ZZZ',
100.0 - (SELECT SUM(cnt) FROM test)