A
A
alhague2021-02-17 12:20:47
SQL Server
alhague, 2021-02-17 12:20:47

How to get the number of selected elements of a list parameter?

I create the report through RS. The report has a parameter with a list of departments: you can select either one or several.
602df17bda87e960571911.jpeg
For calculations in the report itself, you need the ability to get the number of selected values ​​​​and refer to this number in the calculations. How to do it?

Apparently, this option is a table with one row and an arbitrary number of fields, where the fields are the selected items. I tried to create a dataset, where I accessed the parameter as a table variable and tried to calculate the number of columns in various ways, but it didn’t work out - reporting stubbornly considers such a table variable undeclared.
Maybe there are easier ways?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Tsvetkov, 2021-02-18
@tsklab

Textbook .
The selected parameter value goes into the statement IN, not into the table.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question