开发者

How to compute 'Mode' as in Mean, Median Mode using BEX?

开发者 https://www.devze.com 2023-03-05 09:10 出处:网络
Have any one explored how to perform Mode (one of the 3 challenges.. Mean, Median & Mode) using SAP BEx Query Designer/WAD (no BO tools). Any inputs to compute Mode for a data se开发者_如何学Pytho

Have any one explored how to perform Mode (one of the 3 challenges.. Mean, Median & Mode) using SAP BEx Query Designer/WAD (no BO tools). Any inputs to compute Mode for a data se开发者_如何学Pythont would be very helpful.


Apologies if this is unhelpful (not knowing BEx), but in langauges that dont have a sense of order you need to create an extra column which stores the 'order' of the data. Then count the number of observations you have, if it is odd then choose the value related to the observation which = int(observation count)/2+1. Otherwise if it is even, then you (usually) take the mean of the int(observation count)/2 and int(observation count)/2+1 rows.

e.g.1

  • data =1,3,4,8,8,9,9
  • order=1,2,3,4,5,6,7

odd number of observations median = int(7/2)+1 = 3rd observation which is 8

e.g.2

  • data =1,3,4,5,8,8,9,9
  • order=1,2,3,4,5,6,7,8

even number of observations median is between the = int(8/2) and the int(8/2)+1 observations = 4th and 5th observations, which is the mean of 5 and 8 = 6.5

I could write a query in SQL Server to paste in, but not sure if that would be helpful. Let me know ...


Short answer: You can't calculate the mode at run-time since there's no standard functionality in BEx for that and your data is most likely coming out aggregated. Depending on your exact requirement and how your query is built, you may have to resort to calculating it in the backend as opposed to query level.

Good luck!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号