Question

I want to get the department from the default dimension in AX 2012.

In the LedgerJournalTrans->lines->FinancialDiemsion I can fill the department but in the database for AX the default dimension is saved.

I'm working on SSRS reports d=so I want to get the department in SQL query.

Can anyone help me how to get the department and explain simply the relations

Thank you in advance and best regards,

Was it helpful?

Solution

You can use this in SQL:

select DisplayValue from  DefaultDimensionView 
    where DefaultDimension = 1234567890
      and Name ='Department' 

In X++:

select DisplayValue from defaultDimensionView 
    where defaultDimensionView.DefaultDimension == this.DefaultDimension
       && defaultDimensionView.Name == 'Department';

OTHER TIPS

see: How to set a single dimension value in AX 2012?

has a good whitepaper mentioned

Edit: as pointed out this is for ledger dimension and not default dimension, but I'll leave it for info:

Check out the DimensionAttributeLevelValueAllView view. It contains all the data you need.

  • Filter on the DimensionAttributeValueGroup field using the ledgerdimension recid from ledgerjournaltrans.
  • The DisplayValue contains the value of the dimension
  • The DimensionAttribute field refers to the dimension, for example the department, and it links to the DimensionAttribute table. This is setup so you'll have to store the recid for the department somewhere and join with this setup field. Otherwise there is no way to 'know' which of those dimensions the department dimension is.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top