SSRS IIF efficiency

时间:2015-07-31 19:25:54

标签: reporting-services processing-efficiency iif

I am using the following expression to tier the sales figures.

=sum(iif(Fields!InitialValue.Value>=500000 and Fields!InitialValue.Value<1000000,Fields!InitialValue.Value,nothing))

Basically, I just change the greater than and less than values for each cell. We have 4 tiers.

From what I understand, the IIF statement will go through each line and evaluate it before returning anything. I am also averaging the size of each new account, so I have 8 cells that evaluate the data each time. I will also need to add how many accounts are in each tier, which means 12 passes at the same data. It takes some time to generate this report.

Is this the most efficient method?

Thanks in advance for all your help!

1 个答案:

答案 0 :(得分:0)

一种可以提高效率的方法,从我所知道的是两种方式之一,我这样做的方法是在查询中添加一列,用Tier标记每一行,这意味着当数据得到SSRS它已经设置好,永远不需要进行评估。我的理论是SSRS不如查询优化器那么聪明。另一种方法,可能会或可能不会加快速度,是为您的数据集添加一个计算字段,尤其是同样的事情。我相信这会让SSRS计算一次就是这样。