I have figured out how to add a filter to my chart, is there a way that if I leave this filter null that it will display all data as opposed to no data?
This is the line I used to create the filter:
Paint_shop = :P9_Select_Shop
Use
where (Paint_shop = :P9_Select_Shop or :P9_Select_Shop is null)
Related
Utilizing the solution provided by Gordon, I've successfully created a selectable table that contains aggregated data. Now I would like to filter the data with the text-filter-widget.
I understand that the filter needs an array to work properly. What I am trying to understand is how might one be able to update the table rows when the table filters are looking at a group?
A text filter widget is different from a chart in that it takes a dimension to filter on.
We also need to declare a second market dimension so that it will filter the table.
Thus
var marketDim, marketDim2;
// ...
marketDim = facts.dimension(function(d) {
return d.Location;
});
marketDim2 = facts.dimension(function(d) {
return d.Location;
});
// ...
search
.dimension(marketDim2);
Fork of your fiddle.
I have a grid with filter header in every columns. When the user type something in a filter, the datasource send a request to the server to get the data. This is fine when is only one column filter. The problem is when the user after obtain the filtered results needs to filter by another column, and without to remove the previous filter type something in other column filter. In this second situation i need to send all filter values and not only the second filter.
You don't mention what language you use. I assume you do it with javascript.
So you can use the code below.
var grid = $('#ClientsGrid').data("kendoGrid");
grid.dataSource.filter({
field: "client_status",
operator: "eq",
value: "2"
If you need to clear all filters, you can use
var grid =('#ClientsGrid').data("kendoGrid");
grid.dataSource.filter({});
I have two filters that I need to combine.
This is my primary filter:
r.db('items').table('tokens').filter(r.row('valid_to').gt(r.now()))
and this is my secondary filter.
.filter(r.row["processed"] == False)
How do I combine these?
Just chain them together!
r.db('items').table('tokens')
.filter(r.row('valid_to').gt(r.now()))
.filter(r.row["processed"] == False)
And you can keep chaining stuff after that.
Once you have the database set, you can use the filters to carry on your equation, such as:
$query = \r\table('payments')
->filter(\r\row('forwarded')->eq('1'))
->filter(\r\row('bad_callbacks_sent')->lt(6))
->filter(\r\row('confirmations')->le(7))
->run($this->conn);
You see I have the table set, which means I can continue doing queries for that table without re-defining that table.
I'm using dc.js library to generate graphs and I would like to be able to retrieve the filtered data when filters are applied.
Create another dimension and then call dimension.top(Infinity) on it.
https://github.com/square/crossfilter/wiki/API-Reference#dimension_top
You will need the extra dimension because dimensions do not observe their own filters, only the filters on other dimensions.
Then you can use e.g. d3.csv.format to produce text, if you need to.
https://github.com/mbostock/d3/wiki/CSV#format
In the version 4 of d3.js d3.csv.format doesn't exist, you must use d3.csvFormat instead.
const cf = crossfilter(data);
csvDimension = cf.dimension( x => x );
csvContent = d3.csvFormat(csvDimension.top(Infinity), [field, field2, ...]);
As Gordon said, csvDimension must be a new dimension in order for the filters to be applied.
I want to filter out all rows that do not have a specific column. any idea which comparator to use?
You can use skip filter combined with qualifier filter.
If you use the java client API:
Filter filter = new QualifierFilter(CompareFilter.CompareOp.EQUAL,new BinaryComparator(Bytes.toBytes("column-name")));
Filter filter2 = new SkipFilter(filter);
scan.setFilter(filter2);
this will return all the row without that specific column
SingleColumnValueFilter has method setFilterIfMissing that excludes all row that do not contain given column if it is given true. All that is needed is to design filter so it will always pass and call setFilterIfMissing(true)
SingleColumnValueFilter filter = new SingleColumnValueFilter(Bytes.toBytes(columnFamily), Bytes.toBytes("column_name"), CompareFilter.CompareOp.NOT_EQUAL, Bytes.toBytes("non-sense"));
filter.setFilterIfMissing(true);
scan.setFilter(filter);