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


IIF statment issues


IIF statment issues

Author
Message
DaveDB
DaveDB
SSC-Enthusiastic
SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)

Group: General Forum Members
Points: 155 Visits: 215
Hello all,

I am rather new to the syntax of SSRS coding. Basically what I need to do is count a column based on it's contents. So IF the column = "answered", I just want to count Answered. IF the column = "Abandoned", I want to count Abandoned. And Finally IIF the column = "VM", then I want to count VM. I am trying to do this in separate fields, so 1 row for each.

Basically, all of these are just counting whatever is in the column. So if I have 4 Answered and 2 Abandoned, it simply counts 6 regardless of what I enter (Abandoned, Answered, etc.)

Any help would be greatly appreciated.


=COUNT(IIF(Fields!Call_Disposition.Value = "Answered", Fields!Call_Disposition.Value, 0))
=COUNT(IIF(Fields!Call_Disposition.Value = "Abandoned", Fields!Call_Disposition.Value, 0))
=COUNT(IIF(Fields!Call_Disposition.Value = "VM", Fields!Call_Disposition.Value, 0))
DaveDB
DaveDB
SSC-Enthusiastic
SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)

Group: General Forum Members
Points: 155 Visits: 215
I answered my own question Smile Posting here for anyone else who has the same issue...


=COUNT(IIF(Fields!Call_Disposition.Value="Abandoned",1,Nothing))
Greg Edwards-268690
Greg Edwards-268690
UDP Broadcaster
UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)

Group: General Forum Members
Points: 1499 Visits: 8481
Have you looked at pivoting the data?
Date Answered VM Adandoned etc.
Cnt Cnt Cnt
10/22 90 42 4
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