Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

SSRS 2012 - NANS , IIF's, Counts, and Lookups - Can't get them to play nice

$
0
0

Hello, having an issue with NaN values when there is an attempt to divide 0 by 0.   I have two datasets, a year-to-date (YTD) and month-to-date(MTD).   In this expression I want to get the number of tickets not breached and divide by the total number of tickets.  In my datasets the field that hold this info is the im_is_breached.Value which can either be 0 for false, 1 for true, or empty meaning no tickets.

The following gives me the NaN warning when there are 0 tickets for both sides of the express.   I can't figure out a syntax that would work with this to get around the NaN's.   Anyone have an idea?

=(Count(IIF(Lookup(Fields!im_id.Value,Fields!im_id.Value,Fields!im_is_breached.Value,"MTD")="0",1,Nothing)))
/
(Count(IIF(Lookup(Fields!im_id.Value,Fields!im_id.Value,Fields!im_is_breached.Value,"MTD")="1",1,Nothing))
OR
Count(IIF(Lookup(Fields!im_id.Value,Fields!im_id.Value,Fields!im_is_breached.Value,"MTD")="0",1,Nothing)))

An example of the complete table results are below.   This express is used in the total row and % Met column, you can see when MTD and Breached are 0 it gives me the Nan but otherwise seems to work.

Group AMTD Breached% Met

Critical 000.0%
 Totals 00NaN
Group BCritical 10100.0%
High 220.0%
Low 000.0%
Medium 000.0%
 Totals 3233.3%

  

Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>