SSRS Expression - COUNT and IIF

  • Hi,

    I am building a SSRS report. I need to find a COUNT of rows with priority as "high" and business as "COM". 
    I tried expression but it returns count of all rows where Business = "COM" =IIF(Fields!Business.Value = "COM", count(Fields!Priority.Value="High"),0)

    Any suggestion.

    Thanks

  • I'm impressed that runs, you're basing logic on a non aggregate field, and then attempting to do an aggregate.

    Either of these examples should work, depends on your preference. Note; I have counted your Key value in the first example, I don';t know what it is, so you'll need to replace it:
    =COUNT(IIF(Fields!Business.Value = "COM" AND Fields!Priority.Value="High", Fields!YourIDField.Value, NOTHING))

    =SUM(IIF(Fields!Business.Value = "COM" AND Fields!Priority.Value="High",1,0))

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply