SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Need to add % sign for only few rows


Need to add % sign for only few rows

Author
Message
vandana_j79
vandana_j79
Valued Member
Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)

Group: General Forum Members
Points: 64 Visits: 86
Hi

I have SSRS (2008) Report which
line MTD YTD Total
Line 1- Balance 10000 200001 208987
Line 1- Volumne 100 200 330
Line 1- Avg 42 67 78
Line 2- Balance 10000 200001 208987
Line 2- Volumne 100 200 330
Line 2- Avg 42 67 78
Line 3- Balance 10000 200001 208987
Line 3- Balance 100 200 330
Line 3- Volumne 42 67 78

I want to add percentage sign only for Avg. Tried various things but nothing working. Anybody knows how to do this.
So Avg should be like 42%, 67%, 78%
All are numeric fields. Spread sheet attached having table

Many Thanks
Vandana
Attachments
Book1.xlsx (13 views, 9.00 KB)
Sean Lange
Sean Lange
SSC Guru
SSC Guru (61K reputation)SSC Guru (61K reputation)SSC Guru (61K reputation)SSC Guru (61K reputation)SSC Guru (61K reputation)SSC Guru (61K reputation)SSC Guru (61K reputation)SSC Guru (61K reputation)

Group: General Forum Members
Points: 61131 Visits: 17954
Please see the first link in my signature about best practices when posting questions.

_______________________________________________________________

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 Modens splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
abdulkalam.m
abdulkalam.m
SSC Rookie
SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)

Group: General Forum Members
Points: 44 Visits: 168
use below expression in Avg column

="%" & cstr(Avg.Value)
abdulkalam.m
abdulkalam.m
SSC Rookie
SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)

Group: General Forum Members
Points: 44 Visits: 168
try below expression

=IIF(instr(Fields!Line.Value, "Avg")," %" & CSTR(MTD.value),MTD.value)
Divya Agrawal
Divya Agrawal
Ten Centuries
Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)

Group: General Forum Members
Points: 1036 Visits: 604
vandana_j79 (1/18/2013)
Hi

I have SSRS (2008) Report which
line MTD YTD Total
Line 1- Balance 10000 200001 208987
Line 1- Volumne 100 200 330
Line 1- Avg 42 67 78
Line 2- Balance 10000 200001 208987
Line 2- Volumne 100 200 330
Line 2- Avg 42 67 78
Line 3- Balance 10000 200001 208987
Line 3- Balance 100 200 330
Line 3- Volumne 42 67 78

I want to add percentage sign only for Avg. Tried various things but nothing working. Anybody knows how to do this.
So Avg should be like 42%, 67%, 78%
All are numeric fields. Spread sheet attached having table

Many Thanks
Vandana

If you are calculating the average value and then showing in the report, just use the FormatPercent function in the expression.

--Divya
MMartin1
MMartin1
SSCertifiable
SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)SSCertifiable (7.1K reputation)

Group: General Forum Members
Points: 7075 Visits: 2033

If you are calculating the average value and then showing in the report, just use the FormatPercent function in the expression.

--Divya


This is fine if the value is still a ratio, like .29. If the user already has 29 (multiplied .29 *100) then can do just a
CSTR(Fields!yourfield.value) + " %" in the cell's expression.

----------------------------------------------------
How to post forum questions to get the best help
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search