Aggregate functions on string

I have a calculated field in ssrs dataset which evaluated as follows;

iif(<cond>, return date, return string field value) as status

on this expression in tablix, i am suppose to have max(status.value) 

getting #error message in text box when "status" has string value.

Is there any workaround for this.

September 11th, 2015 8:51am

Hi nody88,

According to your description, you have added a calculated field in the dataset, when you use Max() function for this field in a tablix, #error returns, right?

In Reporting Services, the set of data specified in the expression within Max() function must have the same data type. In your scenario, since the calculated field will return two different data type values based on the condition, when use the Max() function, you need to specify the condition for Max() function to aggregate the same data type values. The Max() function should like below:
=Max(IIF(<condition>,return date, nothing)) 

As we tested in our environment, after adding the condition in Max() function, it can return correct maximum value. Please refer to screenshots below:

If you have any question, please feel free to ask.

Best regards,
Qiuyun Yu

Free Windows Admin Tool Kit Click here and download it now
September 13th, 2015 11:25pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics