简体   繁体   English

从 SSRS 表达式中的 LookUpSet 获取最后一个项目

[英]Get last Item from LookUpSet in SSRS expression

How can I get the last item of a array returned by LookupSet?如何获取 LookupSet 返回的数组的最后一项?

For instance, I can get the first, second or sixt item with (0), (1), (5).例如,我可以用 (0)、(1)、(5) 获得第一个、第二个或第六个项目。

LookupSet(source_expression, destination_expression, result_expression, dataset)(5)  

Is there a way to return the last item instead of a specific position?有没有办法返回最后一项而不是特定的 position?

I haven't used the array for a LOOKUPSET but I think you could use you use LENGTH on another LOOKUPSET for it:我没有将数组用于 LOOKUPSET,但我认为您可以在另一个 LOOKUPSET 上使用 LENGTH:

=LOOKUPSET(<source_expression>, <destination_expression>, <result_expression>, 'dataset1')(LOOKUPSET(<source_expression>, <destination_expression>, <result_expression>, 'dataset1').Length - 1) 

Length will return the number of rows returned for the LOOKUPSET. Length将返回为 LOOKUPSET 返回的行数。 I think you'll need to subtract 1 since the array starts at 0 and not 1.我认为你需要减去 1,因为数组从 0 而不是 1 开始。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM