1

So I'm trying to count the amount of fields (called [Emergency]) that are both true and false to multiply by the standard price of either a regular or emergency booking.

Currently this is only working for the emergency revenue calculation(looks like this):

=CountDistinct(Fields!Emergency.Value = True) * 3.0

And lets say there are two records with the emergency field being true, since the price of an emergency booking is £3.00, it outputs as £6.00 total

While the regular revenue calculation looks like this:

=CountDistinct(Fields!Emergency.Value = False) * 1.5

The output of this with four records having the emergency field being false and the price of a regular booking being £1.50 is £3.00, while the expected output should be £6.00

I'm not sure what is causing this problem as it's my first time using SSRS

actualNoob
  • 23
  • 6
  • 1
    Possible duplicate of [Count expression SSRS Report](https://stackoverflow.com/questions/15204530/count-expression-ssrs-report) – StevenWhite Feb 21 '19 at 21:01

1 Answers1

1

You are counting the distinct values of a boolean expression. This takes on two values, which is why you are getting 2.

I suspect you just want to count the number of true values. I don't know how to express this in SSRS, but in SQL, you can do:

sum(case when Fields!Emergency.Value = 'False' then 1 else 0 end)
Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786