There was a need to find in the membrane the most common expression of a certain measure. It is necessary to calculate it in the membrane, since the period may be different and the value should be recalculated accordingly.

If the following code

select [Measures].[Umsatz VK Brutto CM] on 0, non empty ( [Datum].[Monat Key Name].&[201601], [Artikel].[BasVanr Char Name].children, [Hypermarkt].[SBWID].&[67005901] ) on 1 from [GlobusUser] 

returns

  201601 - A - GM67005901 - 10 ัˆั‚ัƒะบ 201601 - B - GM67005901 - 20 ัˆั‚ัƒะบ 201601 - C - GM67005901 - 30 ัˆั‚ัƒะบ 201601 - D - GM67005901 - 30 ัˆั‚ัƒะบ 201601 - E - GM67005901 - 40 ัˆั‚ัƒะบ 

then the member should return the value 30

  • I can offer to sort by frequency by subsample by count, and put the top select top 1 x, count(*) from ( ...) group by x order by 2 desc - nick_n_a
  • I need a member in mdh, not a sql - T.Zagidullin transaction

1 answer 1

This most common distribution term is called mod .
On the example of the bicycle factory

 Create MEMBER CurrentCube.[Measures].[Mode Price] AS iif( IsEmpty( [Measures].[Reseller Transaction Count] ), null, TopCount( [Price].[Price].[Price].MEMBERS, 1, [Measures].[Reseller Transaction Count] ).Item(0).MemberValue ) 

Here, an additional price change is created - Price , without it it does not work.
If without additional measurements, there is a method for calling Excel functions in MDX , and there is a mode search function.