How to Create Query

Hi Master,


I want to create a Query in AX 2012, I have tried a query on SQL, I want to implement SQL code to Query AX 2012.

I have a problem, when I have made the query, the data should appear 4 lines, but when in View in AX 2012 the data show 12 lines.

How I can create query like code SQL below ? Please advice 



*Query SQL


*Properties in Query AX 2012 (what i have to change ?)