lundi 8 avril 2019

'iif' condition is not working with Calculated Field in SSRS

For a dataset in SSRS reports, I've created a calculated field with below expression and it works fine.

=(Fields!SalesAmount.Value+Fields!TaxAmt.Value)*Fields!Factor.Value

But sometime we can have factor value as 0. So, I modified above expression with below:

=iif(Fields!Factor.Value = 0,(Fields!SalesAmount.Value+Fields!TaxAmt.Value)*1,(Fields!SalesAmount.Value+Fields!TaxAmt.Value)*Fields!Factor.Value)

But this throws below exception: The Value expression for the textrun ‘Textbox2.Paragraphs[0].TextRuns[0]’ uses an aggregate function on data of varying data types. Aggregate functions other than First, Last, Previous, Count, and CountDistinct can only aggregate data of a single data type.

Can someone please help to get resolve this issue?

Aucun commentaire:

Enregistrer un commentaire