ag-grid Force "no data" message when setFilter value does not exist - ag-grid

I have a column with multiple possible values. As an example, there might be an "Is Busy" column, with values "No" and "Yes". If there are no rows with "No" as the value, I need to know how to show the "no data" message - this does not seem to work by default. I see suggestions to hard-code the value list, regardless of the values in the dataset. However, I have requirements for those values to be dynamic from the database. For example, we might add "Maybe" to that list later and the grid must reflect it, without needing to modify code.
I'm using the following, where 'No' does not exist in the dataset.
agGridOptions.api.getFilterInstance(col).setModel({ values: ['No'] });
This does not filter the grid, but rather leaves all existing rows.

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.

a number is required in the selection criteria when using a parameter

I am new to CR, and I think this is a complicated question. When a user runs the report, I want the user to input either nothing - which will get everything, or to input the values for that field - to get those specific values. Let me know if I am approaching this right.
I am trying to use a formula in the record selection formula editor. This formula references a parameter. I am trying to use WrkOrder.Center field - which is a number - in my selection criteria.
I am getting the error "a number is required here" in the record selection formula editor. I need to do a totext or cstr ? It just seems to still be incorrect.
if the center is blank then get all centers, else get the selected center input in the parameters by the users running the report.
if {?Center}="" then true else {?Center}=cstr({WRKORDER.CENTERNBR})
if {?Center} = "" then true else {?Center}={WRKORDER.CENTERNBR}
parameters to get what is either input or get all centers
First thing to check is the data type of your parameter and the data type of database field to ensure they match.
If you edit your parameter the first three controls on the form at the top are Name, Type, and List of Values. The Drop Down Box for Type will identify the data type of your parameter.
To identify the data type of your database field, find the field in the Field Explorer and if you don't already see a data type listed next to the column names for each table, right click on any field name and click "Show Field Type" and this will toggle the display of the field data type on and/or off. Its usually off by default I believe.
In order to use a comparison with the = operator, these two objects must have matching data types. You aren't able to change the data type of a database field, but you can change the data type of your parameter to match it.
Hopefully this will fix your error. The most common cause of the error message you are receiving is when one field is a Number type and the other is a Text type. Functions that convert the data will work in formula fields, but usually will continue to throw errors when used in selection expert formulas.

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.

Filemaker value validation against value list

Need to validate values within a field against Value List, retaining the value if on list but substituting a specific Value if not?
I am afraid you are mixing two separate things:
Validation checks if some conditions have been satisfied; if not, it throws an error. It will not correct the entry.
If you want user entry to be corrected, you need to either:
define the field to auto-enter a calculated value; or
attach a script trigger to it, and have the script modify the value entered by the user.
In this case, you could auto-enter a calculated value (replacing existing value) =
If ( IsEmpty ( FilterValues ( Self ; ValueListItems ( Get (FileName) ; "YourValueList" ) ) ) ; "Specific Value" ; Self )
--- Added in response to your clarification ---
Technically, you could run a script to find the records you want to verify and do Replace Field Contents (using the same calculation) on that field. You could run the script after changing the value list, as part of the weekly routine.
However, there are two major problems with this approach:
some records could be locked by another user;
you have no history of what happened, and no way to go back in case of making a mistake.
I also don't think it's good practice to have users modify a value list routinely. If you need to have a weekly list of values, you should store them in records, not in a value list. That way at least the part of the value list would have a history.
Another option you may consider is using an unstored calculation field with a similar formula. This would change dynamically with the value list, and leave the original field unmodified. This would be a good arrangement if, for example, you need to export the corrected values every week.

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