Solved

Business Intelligence Development Studio Expression - Count Boolean Values

Posted on 2011-03-07
4
1,002 Views
Last Modified: 2012-05-11
I am trying to build a report in Business Intelligence Development Studio.  I want to count several columns of boolean data but only the ones that are 'True' or '1'

Here is the expression I was trying to use:
              =Count(IIF(Fields!IsChild.Value,0,1))
The expression above returns the same value as:
              =Count(Fields!IsChild.Value)
Both return a value of 16 which is the total of True's and False's in the column.
0
Comment
Question by:masonrono
4 Comments
 
LVL 15

Accepted Solution

by:
derekkromm earned 50 total points
ID: 35060704
1) Iif syntax is (<expression>, <truevalue>, <falsevalue>), so you want to switch your 0,1 to 1,0 i think

2) Try switching to SUM instead of COUNT
0
 

Author Comment

by:masonrono
ID: 35061675
Thanks, changing it to Sum did the trick.  I know I had tried this with Sum and it gave an error about field type but maybe I had something else wrong elsewhere.  Thanks for the help!
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 36202662
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question