Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Reporting Services
»
Reporting Services
»
Databar with single value
Databar with single value
Rate Topic
Display Mode
Topic Options
Author
Message
DataAnalyst011
DataAnalyst011
Posted Tuesday, September 04, 2012 3:29 PM
Valued Member
Group: General Forum Members
Last Login: Friday, March 22, 2013 11:57 AM
Points: 70,
Visits: 249
This is such a newbie question, but I haven't been able to figure it out. I have a databar that only appears on a single row. I will have to hardcode in my select statement what to evaluate it against. I thought I could do something like this:
SELECT value AS size
FROM table
WHERE condition = 'yes'
UNION ALL
SELECT CAST('100' AS Numeric)
The results would be:
Size
23
100
But when I put the column "size" as my value, nothing happens - the whole bar is shaded. Would someone mind pointing me in the right direction?
Post #1354218
Andy Gerard
Andy Gerard
Posted Wednesday, September 05, 2012 8:33 AM
Grasshopper
Group: General Forum Members
Last Login: Monday, November 12, 2012 4:33 PM
Points: 24,
Visits: 105
does this script work in a query window? i could be wrong but i think you might have to put an "as Size" after the cast statement.
Post #1354595
Sean Lange
Sean Lange
Posted Wednesday, September 05, 2012 9:24 AM
SSCrazy Eights
Group: General Forum Members
Last Login: 2 days ago @ 8:46 AM
Points: 8,547,
Visits: 8,204
Andy Gerard (9/5/2012)
does this script work in a query window? i could be wrong but i think you might have to put an "as Size" after the cast statement.
No, the two select statements are in a union. The first select statement will control the column names. If this was not the behavior then it would allow for the same column to have two different names in the same query.
Here is proof:
select 1 as MyColName union all
select 2 as SomeOther
_______________________________________________________________
Need help? Help us help you.
Read the article at
http://www.sqlservercentral.com/articles/Best+Practices/61537/
for best practices on asking questions.
Need to split a string? Try Jeff Moden's
splitter
.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Post #1354664
Andy Gerard
Andy Gerard
Posted Wednesday, September 05, 2012 9:45 AM
Grasshopper
Group: General Forum Members
Last Login: Monday, November 12, 2012 4:33 PM
Points: 24,
Visits: 105
right, right... sorry for the bad info.
Post #1354692
Sean Lange
Sean Lange
Posted Wednesday, September 05, 2012 10:07 AM
SSCrazy Eights
Group: General Forum Members
Last Login: 2 days ago @ 8:46 AM
Points: 8,547,
Visits: 8,204
Andy Gerard (9/5/2012)
right, right... sorry for the bad info.
No worries.
Now to try to help the OP...I don't understand what the issue is.
_______________________________________________________________
Need help? Help us help you.
Read the article at
http://www.sqlservercentral.com/articles/Best+Practices/61537/
for best practices on asking questions.
Need to split a string? Try Jeff Moden's
splitter
.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Post #1354720
Andy Gerard
Andy Gerard
Posted Wednesday, September 05, 2012 10:27 AM
Grasshopper
Group: General Forum Members
Last Login: Monday, November 12, 2012 4:33 PM
Points: 24,
Visits: 105
if i understand correctly, the OP is looking to have the values returned in the query used as Y-axis values for a bar graph. the query should return two values, (23, 100) and the graph should have 2 points on the x axis with these y axis values, but it's not working.
Post #1354730
DataAnalyst011
DataAnalyst011
Posted Wednesday, September 05, 2012 10:56 AM
Valued Member
Group: General Forum Members
Last Login: Friday, March 22, 2013 11:57 AM
Points: 70,
Visits: 249
You got it. Basically, I'm not sure how to structure the query or the bar graph to make it move around. For example, I have a class that has 100 available seats but only 25 of those seats are taken. So I want to move the bar 25%. The class size (e.g. 100) will have to be hardcoded, but the seats take (e.g. 25) will come from a query. It's a newbie question, but I haven't dealt with charts much before.
Post #1354760
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.