SSRS, Split Value Field before passing to main query - ssrs-2008

I am working on a SSRS report.
I have a parameter. the Value Field gives me IDs separated by delimiters, After user selection, I want the selected value field to be processed and put it in a variable then pass it to the main query to display the result. Please tell me how can I do that, do I need to use script, if yes, how can I? an early reply is appreciated. This is live production issue, so need to fix ASAP.
Thanks

Don't use a single value with IDs separated by delimiters. Instead, set your parameter to accept multiple values and amend your query accordingly.

Related

Filtering a datasource using multi select wild character

Does anyone know if there is a wildcard character in AppMaker that can be used for all possible values for a field in a query?
I currently have a datasource that is being filtered based on the status using a multi-select widget. What I would like to accomplish is when all values have been de-selected I want to load all the records of that datasource without clearing the entire query in case other filters have been applied. I have it working in-a-sense that I have to explicitly construct my query as such:
widget.datasource.query.filters.Status._in = ['Status Value 1','Status Value 2','Status Value 3']
My current solution is loading the correct data when a value is selected and it correctly shows the union of the query as the values are modified. However, it selects all of the values in my multi-select; which I know is how it is supposed to work.
I tried using widget.datasource.query.filters.Status._contains = ''; and changing the assignment value to no avail. I even tried the opposite approach using _notContains
The intended outcome is to have a filtering dashboard appear much like any website where when no filtering is selected all records are displayed. I was hoping to find a wildcard character that would load all of the records. Just trying to find a way to mimic other website filters with all records when none are selected.
Thanks for the time!
So the easiest solution here is to set up your Multiselect as follows:
Options binding:
#models.YourModel.fields.Status.possibleValues
or if you don't have the possible Status values in your model then set your options binding to:
['Status Value 1','Status Value 2','Status Value 3']
Values binding:
#datasource.query.filters.Status._in
Now anytime you select any choices in the multiselect, the query will only include records that include the selected choices. And if you deselect all choices the query will ignore that filter or treat it as an empty array of values, therefore returning all records unless you applied other filters.

adding up specific mergefield values in word

I have a table in a word document that has three colums and all fields are mailmerge fields from an external IT system.
There are three columns displaying the fields:
Charge Description
Charge Value (£)
Eiligible? (yes/no)
I am trying to create a field that adds up all eligibale charges so that only charge values that show a "yes" in the eligigble field are included. Does anyone know if this is possible? I have tried creating a formula but can't get it to work. Also, I would assume at some point an if statment is required so that it only includes the eligible charge.
Has anyone done anything similar before and if so, would they mind sharing how it was achieved?
Many thanks
You can do some things with expression fields (created in Word with CTRL-F9). This will look like {} and you can insert the expression. eg {{MERGFIELD charge} + {MERGEFIELD charge2}}. Since however you want to check multiple values and then create an expression, its probably easier to use a macro. The macro would contain your logic, then set the fields in the document accordingly.
Here are two external links since I can't reproduce a useful amount the content here because it's a verbose answer to a potentially deep question:
Expression Fields
Merge fields
I hope that helps.

Prioritise which identifier to use

My crystal report pulls data about books, including an identifier (isbn, issn order number etc.), author, and publisher.
The ID field stores multiple ways to identify the book. The report displays any of the identifiers for that record. If one book has two identifiers; issn and order number, the report currently displays one apparently at random.
How can I make it prioritise which type to use based on a preset order? I figured some sort of filter on the field could work, but I haven't figured out how. I can't edit the table, but I can use SQL within the report.
If all the different types of ID are stored in a single field, your best bet is to use a SQL Command inside your report to separate them into multiple virtual fields.
Go to Database Fields / Database Expert, expand the connection you want to use, and pick Add Command. From here you can write a custom SQL statement to grab the information you're currently using, and at the same time separate the ID field into multiple different fields (as far as the report will be concerned, anyway. The table will stay unchanged.)
The trick is to figure out how to write your command to do the separation. We don't know what your data looks like, so you're on your own from here.
Based on the very little information that you have provided and if i was to make a guess.I suggest you make use of the formula field in your report and then use something like this to accomplish your goal.
IF ISNULL{first_priority_field_name} OR {first_priority_field_name} = '' THEN
{second_priority_field_name}
ELSE
{first_priority_field_name}
Use nested IF statement in case there are more than 2 identifier fields.

How do you specify the available values parameters in SSRS?

In SSRS ,I'm trying to build a report using this Parameter screen. One of the parameters takes 5 values, shown below:
Src
However, it's not working.. and I'm not sure why. I also don't understand what's the difference between "Available values" and "default values" ? Any tips appreciated, thanks
Available values are those values that you allow that parameter to have. They are selectable from a drop down list. You can either specify them manually, as you have done, or populate the available values from a dataset.
Default Values holds the initial value that the parameter will be set to. This will be one of the available values. In your example you might set the default value to 0 to indicate a default of "No repsonse to survey". If all the parameters have default values then the report will run automatically.
Now you say it is not working but you don't define what not working means. Please edit your question to define what is happening and what you actually want to happen.
I'll take a quick guess that the values returned aren't being filtered by your parameter selection? If so, you have to use your parameter in the query or the Filter expression of your dataset.
For example, if your parameter is called Response then the dataset query should be something like
SELECT *
FROM Responses
WHERE ResponseValue = #Response

Adding "..ALL" to a dynamic parameter

I want to bring in all the values in a specific field to populate a parameter. I can do so, but I also want to add the word "..ALL" to the head of the list so the parameter essentially becomes optional.
When I choose a new data source, I don't seem to have the option of entering a SQL statement to pull the values, I can only choose a field to draw values from.
How do I do this?
You don't see the Add Command option right under the datasource name in the database expert? This let's you enter the sql so you can union the hardcoded 'ALL' option.
Or, you could always use a view or stored procedure.