Question Status

Verified
KBanh asked a question on 19 Mar 2015 9:51 PM

Hello everyone,

I've seen a number of examples which show how to find the default financial dimension value given an item's default dimension recid. However, what I need to accomplish is slightly different. Given a financial dimension, I need to get a count of all the items grouped by the financial dimension values. I hope that made sense. Please let me know if I can clarify anything.

Thanks in advance. 

Reply
Mriganka Bhuyan responded on 20 Mar 2015 1:57 AM

Hello KBanh,

can you please describe the whole solution you are looking for? I mean for eg: you want to group customers, vendors, etc. according to default dimension?

Regards,

Mriganka

Reply
Verified Answer
Dominic Lee responded on 20 Mar 2015 2:07 AM

Do you have specific financial dimension you want to grouped with? Because if you want to group by the combination of all financial dimensions, then grouping by defaultDimensionRecId would do.

kind regards,

Dominic Lee

My blog | PBC

This forum post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

Reply
Suggested Answer
Mriganka Bhuyan responded on 20 Mar 2015 2:16 AM

I agree with Lee's suggestion.

Also, adding to it, you can use this code to understand how to retrieve the default dimension from the DefaultDimension RecId stored for a vendor. This will help you to group your select statement based on the value retrieved.:

VendTable _VendTable= VendTable::find(’VEND-00001′);

DimensionAttributeValueSetStorage dimStorage;

Counter i;

dimStorage = DimensionAttributeValueSetStorage::find(_VendTable.DefaultDimension );

for (i=1 ; i<= dimStorage.elements() ; i++)

{

info(strFmt(“%1 = %2″, DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name,

dimStorage.getDisplayValueByIndex(i)));

}

Hope this helps solving your problem.

Reply
KBanh responded on 20 Mar 2015 9:19 AM

Hello Mriganka / Dominic,

Hopefully this will be enough detail. If I slip on terminology, please excuse me.

I have a default financial dimension on the InventTable which points to a specific dimension 'Product_Category', and these are the only items I'm interested in. Dimension values for Product_Category examples might be B01, B02, etc. What I would like to do is gather all items with a Product_Category default dimension, then group them by values B01, B02, etc. And values is where I would need the count.

Thank you.

Reply
Suggested Answer
Dominic Lee responded on 20 Mar 2015 11:23 PM

Try to modify the example below to get what you want:

domhk.blogspot.hk/.../ax2012-sort-records-by-default-dimension_18.html

kind regards,

Dominic Lee

My blog | PBC

This forum post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

Reply
Verified Answer
Dominic Lee responded on 20 Mar 2015 2:07 AM

Do you have specific financial dimension you want to grouped with? Because if you want to group by the combination of all financial dimensions, then grouping by defaultDimensionRecId would do.

kind regards,

Dominic Lee

My blog | PBC

This forum post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

Reply
Suggested Answer
Mriganka Bhuyan responded on 20 Mar 2015 2:16 AM

I agree with Lee's suggestion.

Also, adding to it, you can use this code to understand how to retrieve the default dimension from the DefaultDimension RecId stored for a vendor. This will help you to group your select statement based on the value retrieved.:

VendTable _VendTable= VendTable::find(’VEND-00001′);

DimensionAttributeValueSetStorage dimStorage;

Counter i;

dimStorage = DimensionAttributeValueSetStorage::find(_VendTable.DefaultDimension );

for (i=1 ; i<= dimStorage.elements() ; i++)

{

info(strFmt(“%1 = %2″, DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name,

dimStorage.getDisplayValueByIndex(i)));

}

Hope this helps solving your problem.

Reply
Suggested Answer
Dominic Lee responded on 20 Mar 2015 11:23 PM

Try to modify the example below to get what you want:

domhk.blogspot.hk/.../ax2012-sort-records-by-default-dimension_18.html

kind regards,

Dominic Lee

My blog | PBC

This forum post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

Reply