如何将不同的值放在相同的参数标签下
我的表看起来与下面选择不同的示例相似。该格式是MainFolder-SubFolder1-SubFolder2
文件夹 |
---|
A |
A-B |
A-BC |
BC |
BDE, |
我想创建一个下拉参数,其中选项将为A或B。如果我选择A,则表将显示A,AB和ABC。理想情况下,我想创建多个参数,以便用户能够选择他们想要查看的主要文件夹以及子文件夹。
我尝试使用以下查询创建数据集 选择不同的文件夹,当文件夹之类的文件夹之类的文件夹时,例如“ b%”之类的文件夹,然后'b'end作为mainFolder
,它为下面的表提供了下面的文件
夹 | mainfolder |
---|---|
a a | a a |
a a-b | a |
-a- BC | A |
B-C | B |
B-DE | B |
I然后创建一个参数,其中可用值来自数据集。值字段是文件夹,标签字段是主基础。我想要它,以便当我运行报告时,参数仅显示A或B,但是表将显示完整的文件夹详细信息。但是,我从下拉参数中得到的是a,a,a,b,B。
I have a table that looks similar to the example below when selecting distinct. The format is MainFolder-SubFolder1-SubFolder2
Folder |
---|
A |
A-B |
A-B-C |
B-C |
B-D-E |
I want to create a drop down parameter where the options would be A or B. If I select A, then the table will show A, A-B, and A-B-C. Ideally I would like to create multiple parameter so users are able to select what main folder they want to look at as well as the subfolders.
I have tried creating a dataset with the following querySELECT DISTINCT Folder, CASE WHEN Folder LIKE 'A%' THEN 'A' WHEN Folder LIKE 'B%' THEN 'B' END AS MainFolder
Which gives the table below
Folder | MainFolder |
---|---|
A | A |
A-B | A |
A-B-C | A |
B-C | B |
B-D-E | B |
I then create a parameter where the available values are from the dataset. The value field is Folder and label field is MainFolder. I want it so that when I run the report the parameter only shows A or B, but the table will show the full folder details. However what I get from the drop down parameter is A, A, A, B, B.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定我是否完全了解您的问题,但是您不仅可以为看起来像这样的参数值创建数据集。
然后,您的主数据集查询将是...
...代码>是您的参数的名称
,或者如果PMAinFolder是多价值,则可以
在OP之后进行**更新**。
假设所有文件夹都有某种形式的定界符(示例中的
-
),则可以对其
在我发布的前示例中
进行替换。 Charindex在
文件夹
列中为我们提供了第一个-
的位置。因此,在“ admin-south”中,这将是位置6,然后我们减去1给我们5 “I'm not sure I fully understand your issue but can you not just create dataset for the parameter values that look something like this..
Then you main dataset query would be something like ...
... where
pMainFolder
is the name of your parameteror if pMainFolder was multi-values you could do
**UPDATE ** after OP additional info.
Assuming all the folders have some form of delimiter (the
-
in your example) you can substitute thiswith
in the previous examples I posted.
CharIndex gives us the position of the first
-
in theFolder
column. So in "Admin-south" this would be position 6, we then subtract 1 giving us 5 and use that in theLEFT
function so we only get back the first 5 leftmost characters, in this example "Admin"