A basic example of getting the Worker and Department per Customer out of the Financial Dimension table , would be something like the following: select ct.ACCOUNTNUM,ddv.DISPLAYVALUE 'SalesRep Id', DDV2.DISPLAYVALUE 'Department' from CUSTTABLE ct inner join defaultdimensionview ddv on ddv.DEFAULTDIMENSION = ct.DEFAULTDIMENSION and ddv.BACKINGENTITYTYPE = 11759 inner join defaultdimensionview ddv2 on ddv2.DEFAULTDIMENSION = ddv.DEFAULTDIMENSION and ddv2.BACKINGENTITYTYPE = 11765 As you can see, each of the joins has its own BACKINGENTITYTYPE, so I can get from one the department and from the other join the worker. Cheers.
↧