SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Development Tools
 Reporting Services Development
 Calculated filed
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kishoremcp
Starting Member

India
39 Posts

Posted - 09/23/2013 :  08:02:42  Show Profile  Reply with Quote
Hi,

I want to have something like "Laptop Tickets/Total Tickets" in percentage.

I have the following in SSRS existing. As I am new to SSRS and SQL please somebody help me in getting this done.

In Fields in properties of that matrix, Laptop Tickets and Total Tickets are falling under headding Naming and the numbers are named as Mertics.

I hope I am clear.

Thanks in advance..


Naming Metrics month_key
Laptop Tickets 1  Jul-13
Laptop Tickets 11  Jul-13
Laptop Tickets 13  Jul-13
Laptop Tickets 14  Aug-13
Laptop Tickets 4  Aug-13
Laptop Tickets 87  Aug-13
Total Tickets 232  July-13
Total Tickets 343  July-13
Total Tickets 132  Aug-13
Total Tickets 543  Aug-13

i am taking sum while displaying in SSRS. (FYI)




Regards
Kishore

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 09/23/2013 :  13:13:45  Show Profile  Reply with Quote
use expression like

=IIF(Sum(IIF(Fields!Naming.value="Total Tickets",Fields!Metrics.value,0))>0,Sum(IIF(Fields!Naming.value="Laptop Tickets",Fields!Metrics.value,0))/Sum(IIF(Fields!Naming.value="Total Tickets",Fields!Metrics.value,0)),Nothing)

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

kishoremcp
Starting Member

India
39 Posts

Posted - 09/24/2013 :  01:53:42  Show Profile  Reply with Quote
Thank you. It seems it is working.
Thank you very much.

:)

quote:
Originally posted by visakh16

use expression like

=IIF(Sum(IIF(Fields!Naming.value="Total Tickets",Fields!Metrics.value,0))>0,Sum(IIF(Fields!Naming.value="Laptop Tickets",Fields!Metrics.value,0))/Sum(IIF(Fields!Naming.value="Total Tickets",Fields!Metrics.value,0)),Nothing)

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs




Regards
Kishore
Go to Top of Page

kishoremcp
Starting Member

India
39 Posts

Posted - 09/24/2013 :  03:01:12  Show Profile  Reply with Quote
for the above output,
I am trying to find the 1 month change (Sep-13 and Aug-13) sep-aug(minus) with the below formula, but unable to get the result.
=(Sum(IIF(Fields!Month_key.Value = MAX(Fields!Month_key.Value), Fields!Value.Value, 0)) - Sum(IIF(Fields!Month_key.Value = MAX(Fields!Month_key.Value)-1, Fields!Value.Value, 0))) / Sum(IIF(Fields!Month_key.Value = MAX(Fields!Month_key.Value)-1, Fields!Value.Value, 0)) * 1
What is wrong?
What should i change in the expression?

How do i club the two expressions?

Regards
Kishore

Edited by - kishoremcp on 09/24/2013 03:02:18
Go to Top of Page

kishoremcp
Starting Member

India
39 Posts

Posted - 09/24/2013 :  03:59:58  Show Profile  Reply with Quote
I want to calculate the below three fields. I am unable to get those using expressions.
1. 1 Month Change (Current month - Previous month) based on column headings (Laptop Tickets, Total Tickets, and Laptop Tickets as % of Total).
The above are listed under the column name in SSRS as Naming.
2. 12 months average for the same (Laptop Tickets, Total Tickets, and Laptop Tickets as % of Total).
3. 12 months sum also for the same (Laptop Tickets, Total Tickets, and Laptop Tickets as % of Total).

The data is available and the same data is used for this requirement also. So, attaching a screenshot for reference.

Metric Jul-12 Aug-12 Sep-12 Oct-12 Nov-12 Dec-12 Jan-13
Total Tickets 122,230 129,244 122,230 137,360 121,162 99,513 130,827
Laptop Tickets 7,869 5,335 7,869 6,800 4,763 3,601 5,043
Laptop Tickets as % of Total 6% 4% 6% 5% 4% 4% 4%


The percentages are calculated using the expression given by visakh16 above and it is working. I hope I am clear.

I am completely new to SQL and SSRS. So why I need help.

Thanks in advance..


Regards
Kishore
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000