Dynamics AX 2012, filtering out data in queries by using business logis - methods

I am using Dynamics AX 2012 R2.
I am creating a query for a view where I have to filter out data based on predefined business logic.
For example, I have one table in my query (simplified) and I want to be able to filter out rows in the view where the sum of value1 and value2 and value3 are equal to zero.
I cannot use the query range in the query since I have around 20 values (columns) that I need to check before I filter out the rows. It doesn´t allow it, it only handles around 10 values or so
I dont like creating a "full" view, e.g. view with all rows then a view method with the business logic that has to be applied to filter out the rows and then a query based on that view where the rows are filter out.
Do you have any ideas?

Why not make a computed view field for the sum of your fields?
I dont like creating a "full" view, e.g. view with all rows then a
view method with the business logic that has to be applied to filter
out the rows and then a query based on that view where the rows are
filter out.
You are cutting out a useful method (but you need not make any queries).
Another approach would be to make a redundant field in your base table with your 20 fields added.
Update: Please read View Basics.

Related

Oracle Rest – filtering by columns (vertical filtering)

I would like to specify in Oracle REST query which columns should be returned in the select statement.
One of the solution would be to use view, however in my case I would like to select columns in a dynamic fashion.
Such functionality is available in PostgREST: http://postgrest.org/en/v6.0/api.html#vertical-filtering-columns
Is there such feature in Oracle REST Data Services?
No, we offer row filtering but not column selection.
So i can say which rows I want to come back via the URI, but I cannot say which columns I want.
So if you REST enable a table or view, it will be all of those columns, of it it's a RESTful Service, it will be the columns you have included in your SELECT.
Something else to keep in mind, we do have a REST Enabled SQL Feature...where you POST your query, and we get you the results. So in the POST you could specify the columns you want.

Sorting Issue After Table Render in Laravel DataTables as a Service Implementation

I have implemented laravel dataTable as a service.
The initial two columns are actual id and names so, I am able to sort it asc/desc after the table renders.
But the next few columns renders after performing few calculations, i.e. these values are not fetched directly from any column rather it is processed.
I am unable to sort these columns where calculations were performed, and I get this error. And I know it is looking for that particular column for eg outstanding_amount which I don't have in the DB, rather it is a calculated amount from two or more columns that are in some other tables.
Any Suggestions on how to overcome this issue?
It looks like you're trying to sort by values that aren't columns, but calculated values.
So the main issue here is to give Eloquent/MySql the data it needs to provide the sorting.
// You might need to do some joins first
->addSelect(DB::raw('your_calc as outstanding_amount'))
->orderBy('outstanding_amount') // asc can be omitted as this is the default
// Anternative: you don't need the value sorted by
// Don't forget any joins you might need
->orderByRaw('your_calc_for_outstanding_amount ASC')
For SQL functions it'll work as follow
->addSelect(DB::raw('COUNT(products.id) as product_count'));
->orderByRaw(DB::raw('COUNT(products.id)'),'DESC');

Having two Filters in one table using SlickGrid

I want to create two filters in one SlickGrid Table. One will have "input field" based filter where i should be able to put expression, i.e. value > 10 which will give me the results greater than 10 values. The second filter will be the excel like filter where it should be able to list all the values from the first filter result and once user select some values it should show those selected values as result.
Basically, looking for combining result of two filters.
I do have some examples as mentions below
http://mleibman.github.io/SlickGrid/examples/example-header-row.html
http://danny-sg.github.io/slickgrid-spreadsheet-plugins/examples/example-2-everything.htm
Looking into combining above two filters in one table.
Is it possible to write two filters in one table using SlickGrid? Let me know how to achieve the same.

Can I combine datasets in Report Builder 3.0?

I have 3 different datasets. Each pulls from the same datasource, but each has different filters in order to pull data as of a different points in time (12/31/15, 12/31/14, and 12/31/13). Each dataset contains the fields: enum, gender, and YearEnd (YearEnd I created using an expression). Can I combine the data from all 3 datasets into one table or matrix. My ultimate goal is to create a chart to show trends over time, but I can't figure out how to combine the data. Since I have different filters for each, I believe I have to have 3 datasets. I just can't figure out how to append them all into one. Thoughts?
I believe your best bet would be one combined dataset instead of three. Create a dataset that gets you the data for all three dates.
You can filter for the rows you want (date in ('12/31/15', '12/31/14', '12/31/15')) in either your SQL query/stored procedure or in your dataset options (right click dataset, properties, filters).
You can also filter at the table level (right click the outside border of the table, tablix properties).
You can break up your table to show different dates using column and row groups, as defined with group expressions, and use expressions as well to display custom headers (2015, 2014, 2013)
I haven't done much with charts in Report Builder, but from looking at it it looks like you can use filters and groups much the same way.

iReports Grouping Bug - Multiple Occurrences?

I'm am getting irritated with iReports. Problem is that I have a data set returning data for multiple customers and I want to use the "Group Expression" against the customer ID and have the report lay out the Detail Tabs per customer.
I'm finding that, seeming randomly, where there is more that one data row for a customer iReports will generate two or more groupings (Sometimes it does what I expect and group all the customer data together), the field IDing the customer is the same and doesn't change.
Has anyone seen this before? To be honest I can't believe it is actually a bug, but something I've missed. Just much searching as yet to find a suitable result.
I think this is a data sorting problem.
The quote from iReport Ultimate Guide:
JasperReports groups records by evaluating the group expression. Every
time the expression's value changes, a new group instance is created.
The engine does not perform any record sorting (if not explicitly
requested), so when we define groups we should always take care of the
records sorting. That is, if we want to group a set of addresses by
country, the records we select for the report should already by
ordered by country. It is simple to sort data when using an SQL query
by using the ORDER BY clause. When this is not possible (that is, when
obtaining the records from an XML document), we can request that
JasperReports sort the data for us. This can be done using the sort
options available in the query window
You can sort data in these ways:
in case using of Database jdbc connection datasource type you can add ORDER BY customerId clause to the report's query, where customerId - column name of field with customer id
in case using of File csv connection or something like this you can organize data sorting by adding sortField property for field to the report's template (jrxml file):
<jasperReport ...>
...
<field name="customerId" class="java.lang.String"/>
<sortField name="customerId"/>
SQL Statement has ORDER BY?
iReport group is grouped by customer_id?

Resources