Solved

Business Intelligence Development Studio Expression - Count Boolean Values

Posted on 2011-03-07
4
994 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how the fundamental information of how to create a table.

863 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now