2
votes

Currently I am working in a Report sections. In this I have one doubt.

In my Report I have 3 tables with relation on one field. I want to filter the data based on that common field I used in the JOIN query.

2
Could you please be more specific regarding the query, if possibly write it as an X++ or SQL query. - Jan B. Kjeldsen
Filtering are done by ranges, whether or not there are relations. What is your problem? Please state your question. - Jan B. Kjeldsen

2 Answers

1
votes

Create a new range on the top level datasource for the field you want to filter by. This will create a parameter for the report that can be used to filter the data. If the joins are set up properly on your report, this should filter your dataset to only contain records containing the selected value.

0
votes

Just use a range on the specific field. If you equal join on the field in the relations node, it does not matter on which table you put the range on.

Example:

select inventTable
     where inventTable.ItemId == "000100"
     join inventTrans
     where inventTrans.ItemId == inventTable.ItemId 
     join inventTransPosting
     where inventTransPosting.ItemId == inventTrans.ItemId &&
           inventTransPosting.Voucher == inventTrans.Voucher &&
           inventTransPosting.TransDate == inventTrans.TransDate &&                                
           inventTransPosting.InventTransId == inventTrans.InventTransId
{
    ....
}

In this query you might as well use:

where inventTransPosting.ItemId == "000100"