Filtering a datasource using multi select wild character - filtering

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.

Related

Ag-Grid Set Filter update list of available values after initialisation

I am using Ag-Grid Enterprise and have applied a set filter to a column, so far so good. I am using Server side row model and am pivoting data successfully on the backend (C# ASP.Net Core).
Once a user applies a filter to one column, I want the other column filters to be updated with a new list of available values that has been limited based upon the column filters that are set.
For example:
Colours:
Black
Orange
Red
Yellow
Blue
In Rainbow:
True
False
Now the idea is that when I set In Rainbow filter to True, I will update the Colours list to exclude black, the logic behind that is done on the C# side and thats fine, basically I fire a query to the server that will include In Rainbow = true, and it will return me an array of the colours that match this particular query.
So I can get the array of colours in javascript back and grab the filter successfully, i.e.
var data = ["Orange", "Red", "Yellow", "Blue"];
var filter = gridOptions.api.getFilterInstance(columnName);
However I cannot find a way to tell ag-grid that I have new values that I want to make available in the set list.
I have tried:
filter.setFilterValues(data);
and
filter.setModel({
type: 'set',
values: data
});
But neither appear to make changes to the set filter values that are available to select.
Any help on this would be greatly appreciated
i'm not sure i completely understand your question but as far as i understand you want to set the values in you filter dynamically or something along these lines and if that's what you want i would suggest that you use filterParams. filterPramas has an attribute for value so it would go like this filterParams:{values:getvalues} get values will bet the function that will return the values you want there is the link to the filterParameters in ag-grid docs https://www.ag-grid.com/javascript-grid-filtering/#filter-parameters

Tableau parameter filter with multiple values?

In Tableau 9.2, I currently have a parameter set up which contains multiple string values and an additional "All" value. I also have a calculated field which only contains the Str([some_field]) function. I have then dragged this calculated field into the "filters" pane and from there enabled "use all" and put the following formula under the "condition" tab:
// If All is selected, then do not filter
[my_filter_parameter] = 'All' OR
// Otherwise, filter on the current parameter
[my_filter_parameter] = [my_calculated_Field]
After creating the calculated field for multiple sheets in my dashboard (which use different data sources all contain the common some_field), then I can change the parameter's value and it will filter all of the sheets at once.
My issue is that I need this to take on multiple values at once via a check-box. I understand that a parameter can only take on one value at a time, so I am wondering how I can do this without making the same filter for each individual sheet in the dashboard. Perhaps this can be done with a calculated field?
EDIT: I have tried the technique here to make a global filter via a control view. This allows me to use Ctrl+Clicking to select multiple values in some_field at once, however I still do not have a dropdown box. Alternatively, if anyone knows how to use this method with a dropdown box, then that would be another solution.
If I am understanding your situation correctly, I have accomplished this using the following:
Create a calculated field and put the following code:
if [parameters].parametername = 'All' then true
elseif [parameters].parametername = FILTEREDCOLUMN then true
else false
end
Add that calculated field to the filters pane and select "True" - in other words, filter out any records where the calculated field is False. If the parameter you selected is "All" then all records will be True. Otherwise, it will only be True if the parameter matches the FILTEREDCOLUMN. I hope that helps.
Parameter can pass only one value at a time ,i.e. Parameter Control will have Single Drop Down List.

Select All parameter doesn't work in SSRS

I have a report which creates a list of Events for a specified date range and event type.
The date range and event type are parameters defined in the report. The date parameters (#DateFrom and #DateTo) work as they should.
The #EventType parameter however, which is defined as a list of values provided by a DataSet (with 'Allow Multiple values' checked), does not provide the expected behaviour when using the {Select All} check box. If I select one or more Event Types by checking several boxes on the list, the report will show the Events which match the specified Event Types correctly.
However, if I click the {Select All} box (which then highlights all of the other possible values), the report does not show the Events for all of these Event Type values. It seems to miss out several of the values which are selected by the {Select All} box. If I run the report specifically for those missing values, the report returns events matching those types. This indicates to me that there is not a lack of data for these types.
And for that reason, it looks to me like the {Select All} is bugged...or perhaps cached somewhere? I've tried deleting the report/parameter dataset and redeploying to no avail. It's worth noting that this behaviour happens locally before deploying it, too.
Has anyone seen this before, or does anyone have any suggestions?
EDIT - I should also mention that the parameter in question (#EventType) has no default value assigned.
How are you declaring your predicate for the variable? It should be be like:
where thing in (#Variable)
Where #Variable is a multi value parameter.
You could attempt to see if the values of the multi valued parameters are junked up somewhere as well by defining them. Generally the collection method of multi valued parameters can cause issues if there data types are different.
Also you may try to design your data set at runtime to build instead of being a static query. EG: Set up an expression for your dataset like:
="Select * from table where thing in (" & Parameters!Variable.Value & ")"
This would cause the parameter to build as part of a string and then evaluate at run time instead of from a traditional query.
Can't quite believe that this was the case, but the parameter which was passed to the SQL Server procedure was too small. It was defined as a VARCHAR(500) and needed to be bigger to deal with a large list of comma separated values. I changed it to VARCHAR(4000) and it's now functioning as expected.
Thanks to Djangojazz for pointing me to the direction of the parameter.

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.