简体   繁体   中英

SSRS: Multi-value parameter with repeated values

I'm having issues with multi-value parameters. I was expecting I could load distinct values for the label and value combination from the default dataset but it's not working.

I have a query that looks like this:

Id  Name   Col1   Col2
1   Foo    aaa    ddd
1   Foo    xxx    sss
1   Foo    yyy    zzz
2   Bar    bbb    eee
3   Huh    ccc    fff

And want to grab the ID - Name combo from the dataset. Ideally, the results would be:

Value Label
1     Foo
2     Bar
3     Huh

However, the actual results are:

Value Label
1     Foo
1     Foo
1     Foo
2     Bar
3     Huh

EDIT: I consider this a poor solution, but made a new dataset only to collect the fields as I needed them and populate the parameter dropdown list. It's not the prettiest outcome, but should work until I find a proper way to do it.

Some of my colleagues are telling me this is the only way to do it, so I have to create a new data set every time I want to fill a new multi-value parameter from a query... Please tell me if it's actually the way to do it, I find it extremely inefficient.

您必须为每个参数创建一个数据集,以便正确输入。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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