简体   繁体   English

如何对Lookup / MultiLookup / LookupSet返回的值进行分组

[英]How to group on the values returned by Lookup/MultiLookup/LookupSet

I have 2 datasets that come from two different data sources. 我有2个来自两个不同数据源的数据集。 DataSet1 and DataSet2. DataSet1和DataSet2。

This is how DataSet1 looks like: 这是DataSet1的样子:

CustomerName      City      State            Zip
Cust1           Cust1City  Cust1State     Cust1Zip
Cust2           Cust2City  Cust2State     Cust2Zip
Cust3           Cust3City  Cust3State     Cust3Zip

This is how DataSet2 looks like: 这是DataSet2的样子:

CustomerName     OrderDate       OrderType       Amount
Cust1           01/01/2014       OrderType1       $100
Cust1           01/02/2014       OrderType2       $150
Cust1           01/03/2014       OrderType3       $75
Cust2           01/01/2014       OrderType1       $250
Cust2           01/02/2014       OrderType3       $450
Cust3           01/01/2014       OrderType1       $145
Cust3           01/02/2014       OrderType2       $400
Cust3           01/03/2014       OrderType3       $10

I am trying to display this information in SSRS report that will have Group on City, State, Zip from DataSet1 and then Group on OrderDate. 我正在尝试在SSRS报表中显示此信息,该报表将对DataSet1进行城市,州,邮政编码分组,然后对OrderDate进行分组。

Since OrderDate is coming from the different dataset, i am not able to Group on it. 由于OrderDate来自不同的数据集,因此我无法对其进行分组。

I tried using Lookup and MultiLookup but that throws me this error: 我尝试使用Lookup和MultiLookup,但这引发了这个错误:

The Group expression for grouping 'table1_Details_Group' uses a lookup function 
with an expression that returned a datatype that is not valid for the lookup 
function. The datatype must be an RDL Variant Type.

Lookup, MultiLookup, LookupSet returns array but is there a way to use them to achieve the grouping on the values returned by them? Lookup,MultiLookup,LookupSet返回数组,但是有没有办法使用它们对它们返回的值进行分组?

Is there an alternative to this? 是否有替代方法?

This is how my Grouping expression looks like: 这是我的分组表达式的样子:

=LookupSet(Fields!CustomerName.Value,Fields!CustomerName.Value,Fields!OrderDate.Value,"DataSet2")

Your design doesnt make any sense to me - how can you expect to group on an expression that returns multiple values? 您的设计对我没有任何意义-您如何期望对返回多个值的表达式进行分组?

I would try basing the table on Dataset2, then you can use a Lookup to get anything you need from Dataset1 (assuming CustomerName is unique across Dataset1). 我会尝试将表基于Dataset2,然后可以使用Lookup从Dataset1中获取所需的任何内容(假设CustomerName在Dataset1中是唯一的)。

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

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