MSSQL Reporting Services - Using expressions in layout view eg: Count(Distinct(FieldName))

Hello Experts!

Is there an alternative to using =count(distinct(Fields!FieldName.Value))in layout view?

I get error BC30451 Name 'distinct' is not declared.

Thanks!



tomfolinsbeeAsked:
Who is Participating?
 
simon_kirkCommented:
Try this instead:

The syntax for CountDistinct() is

CountDistinct (Expression, Scope, Recursive)

Return Value : Integer
Returns the count of all distinct nonnull values of the expression within
the scope

Expression : Variant
The expression to aggregate.  Cannot contain any aggregate functions.
Typicaly this will be something like Fields!<FieldName>.Value

Scope :  String
Name of a DataSet or the name of a Grouping or DataRegion that contains
(directly or indirectly) the report item

Recursive :  Enum
Recursive | Simple (Default).  Indicates whether the aggregate should be
calculated recursively.  Optional.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.