2

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.

Jan B. Kjeldsen
  • 17,817
  • 5
  • 32
  • 50

2 Answers2

1

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.

Michael Brown
  • 2,221
  • 2
  • 17
  • 34
0

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"
Jan B. Kjeldsen
  • 17,817
  • 5
  • 32
  • 50
  • Thank You for reply, Actually my problem is I am doing Reports in AX 2009. In this report I am using three tables to retrieve data in which I have common Field – user1088734 Dec 12 '11 at 19:38
  • Yes, but then your query will have a common field like `ItemId` above. You will have to describe your problem more clearly, if you expect answers to your question. – Jan B. Kjeldsen Dec 13 '11 at 07:02