AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 10.08.2019, 04:57   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
How to filter existing transactions based on a financial dimension value set
Источник: http://alexvoy.blogspot.com/2019/08/...nsactions.html
==============

Let's assume that we want to see our bank accounts balances grouped by a financial set, which may be different than that set up for your transactions.



For example, existing transactions presume to have values for the following dimension attributes.





However, our selection can be different. For this exercice sake I opted for Business unit and Department.




So, instead of one balance for the whole bank account, we want to get it distributed per every combination of Business unit and Department values.









Another point to consider is the fact that these attributes are not mandatory; in other words, we don't have values for all attributes in all transactions.


It can be easily achieved if we find a way to create a column with all sought dimension attribute values concatened as depicted.



Generally speaking this is a job a BI solution; however, it is possible to do in D365 by means of Views.

Let's solve this problem step by step.

Fisrt view is for all selected attributes that we should populate values for, exist them or not.



Second, collect all existing values which match our selected attributes.



Then, group all found dimension attribute sets.



Now we create a view based on the latter and sought attributes without relation in outer join. By that we will get a Carthesian product of all possible combinations between them.



At this step we outer join the latter with the found (existing) values. Here we can add a computed column if we want to see something else than just an empty value.




private static server str displayValueWithNA() // X++
{
str sRet;
tableName viewName = viewstr(CDPDimensionAttributeValuesUnionView);
str cDisplayValue = SysComputedColumn::comparisonField(viewName,
viewstr(CDPDimensionAttributeValuesSelectedView),
fieldStr(CDPDimensionAttributeValuesSelectedView, DisplayValue));

sRet =
SysComputedColumn::if(SysComputedColumn::isNotNullExpression(cDisplayValue),
cDisplayValue,
SysComputedColumn::returnLiteral('n/a')
);

return sRet;
}



Final view will contain all the values found on the previous step grouped by dimension attribute value set so that in a computed column all values be concatened in the required order.





private static server str finDimValues() // X++
{
return @"STUFF((SELECT '-' + t3.DisplayValue
from CDPDimensionAttributeValuesUnionView as t3
where
t1.DimensionAttributeValueSet = t3.DimensionAttributeValueSet
order by t3.DIMENSIONATTRIBUTE
for xml path('')), 1, 1, '')";
}


Having this view in inner join combination allows you to filter any transactional data by a set of dimenions without coding.





Источник: http://alexvoy.blogspot.com/2019/08/...nsactions.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
How to lookup and set a new value for Financial dimension Blog bot DAX Blogs 0 03.10.2015 02:35
emeadaxsupport: How to change the Storage dimension group on items with existing Inventory transactions Blog bot DAX Blogs 0 01.10.2015 21:11
NAV Team: Filtering on Dimension Values Blog bot Dynamics CRM: Blogs 0 12.06.2012 18:02
Khue Trinh: Setting up a link between a financial dimension and the site inventory dimension Blog bot DAX Blogs 0 27.09.2010 13:05
wiki.dynamicsbook: Changes Made in Navision Attain 3.60 Blog bot Dynamics CRM: Blogs 0 02.09.2008 13:23
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 08:29.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.