How to add distinct to filter expression in Defined Selector in Openbravo? - hql

The filter expression which I am using now is,
"e.contract= '" +OB.getParameters().get('subscriptionId') + "'"
Here, e is the current table which is populated in 'Table' , and contract is the column there (In the POJO class) which stores the value of subscriptionId.
The issue is the attribute in the next level Defined Selector Field ,which I display a certain column exColumn has many rows [selected from the above expression] with same value.
Here , I intend to add a distinct in the filter expression or in the HQL [which doesn't seem to be filtering at run time] or in the Defined Selector Field, so that we don't display repeated values.

You cannot add distinct in a Filter Expression, which is used to restrict the results of the datasource.
You have 2 different options:
Define the selector based on a Custom Query and write there the HQL to retrieve the values. In this query you can have the distinct. As example you can check Business Partner not filtered by default by customer/vendor selector which is implemented in this way.
Base your selector on a Table from a view:
Create a database view with the base SQL query you need including the distinct.
Register it as an Application Dictionary Table
Base your selector on it

Related

How to search an array element in SurrealDB

I'm trying to perform a query that evaluates if an array includes or contains a specif value or set of values.
SELECT * FROM table
WHERE data = ['value_a']
https://surrealdb.com/docs/surrealql/statements/select
I've read the documentation and try several queries, but I didn't find any function or way to create this query.
I've read the official documentation and performed several queries based on the examples, but nothing have worked.
https://surrealdb.com/docs/surrealql/statements/select
My expected behaviour is:
Matches a specific value or set of values like these examples in SQL relational database.
https://www.w3schools.com/sql/sql_in.asp
There is a CONTAINS operator :
https://surrealdb.com/docs/surrealql/operators#contains
The Query should be like:
SELECT * FROM table WHERE data CONTAINS 'value_a'

How to use values from a list aggregated field in a table to a filter in Quicksight?

I have a dashboard in Quick-sight where a table is being used which contains a field that has values list aggregated.(Please refer the attached image).
I need to create a filter in a dashboard that will have a dropdown with distinct values from the list aggregated values so that if i select/check a particular value from a dropdown then it should filter out the list aggregated record by matching the string i selected in a drop down.
I tried to use the split function to get the distinct values from the list aggregated values from the field. However, the filter did not work as i expected.
Please suggest possible solution. Will appreciate any suggestions.

Quicksight control to include nulls

I have a quicksight dataset where one of the data fields is routingtype which can be filled with "Agent_direct", "agent_select" and "null" as the values. I have created a parameter and filter linked to the parameter but when I create the control and link it back to the dataset and routingtype field I am unable to filter by null values in the control. Is there a way to include those in the control?routing type control

Filter data table for multiple condition in UiPath

So I am using UiPath to automate a process by searching a DataTable on a specific column with a range of keywords. I know that we can use the Filter Data Table and add on the keywords that I want but I have about 130 keywords to be matched and it's troublesome to add one by one using the Filter Data Table function.
Is there any way that I can use like creating a list and match the list or something and give the output that matched?
You can use Datatable.Select to filter a datatable with multiple conditions fairly easily.
myDataTable.Select("[Column x] Not in ('value1', 'value2', 'value3')")
Will give you all the DataRows where the field in your datatable called Column X is not value1, value2, or value3

Use a Field value in a Query (Seblod Query plugin)

I'm using the Query plugin that lets me create a Query field on my List & Search.
I have a hidden field with ID 'id_number' which I'm trying to use in my query. When I check the Page Source(Ctrl+U on Chrome), the hidden field has the correct value of id_number which is '22865'.
The part of my Query is-
WHERE [MATCH]p.pid||$cck->getValue('id_number')[/MATCH] AND (ban_reason in ("", "active"))
When I print this query out using the Debugger, the Query is using the literal value and querying the above as-
(p.pid LIKE '%$cck->getValue(\'id\_number\')%') ....and not like (p.pid LIKE '%22865%')
I also tried using $fields['id_number']->value but it still queries it incorrectly.
Should I not use $cck->getValue('id_number') to get the value of the hidden field in the query? Or is there something other than this that I need to use?

Resources