Quantcast
Channel: SQL Server Analysis Services Forum
Viewing all articles
Browse latest Browse all 2472

Total for member that id devided on other member that is different for products

$
0
0

Hello, i'd like to calculate AchievedProfit in mdx without VAT using this formula: AchievedProfit=GrossProfit/VAT for diferent product.

VAT - calculated member

GrossProfit - measure

Achieved Profit - calculated member

The bottom mdx code explain my needs:

with 

member VAT as
    iif(Ancestor([Products].Currentmember, [Products].[Level1]) is [Products].[Fruit], 1.1, 1.18)
--    , solve_order = 4000

member AchieveMargin as [Mesures].[GrossProfit]/VAT
--, solve_order=5000

member [Products].Potatoes as [Products].&[7107]
member [Products].Fruits as [Products].&[7126]
member [Products].Water as [Products].&[7174]

member [Products].Total as
    [Products].Potatoes
+    [Products].Fruits
+    [Products].Water
--    , solve_order=2000

select
{GrossProfit, VAT, AchieveMargin} on 0,
{
[Products].&[7107],
[Products].&[7126],
[Products].&[7174],
[Товары].Total
}
on 1
From test

So, using this code i recived necessery value, but total is calculating wrong!

For example:

                GrossProfit     VAT     AchievedMargin

Potatos      1180             1.18         1000

Fruits         1100             1.10          1000

Water        1180              1.18         1000

Tota           3460              1.18         2932.20

But i need recieve

Total          3460              1.1533      3000

Hot can i get this?

Thank you in advance!





Viewing all articles
Browse latest Browse all 2472

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>