on 06-29-2016 6:00 PM
Hi!
This is my first time posting in the community so if this is out of topic please let me know. I was asked by a client to make a report which includes calculating the Median for a set of data. Has someone found a way to do this calculation using just tools from SAP HANA calculation views? I would need to do it within the view and just output the result as a column.
One way I thought could work would be to use a Rank node and split it in half but since I cannot use a variable as the Rank's Treshold this option is not viable. Or is it? Is there a way to make the Rank's Treshold variable?
Thank you all in advance for your help.
Regards,
Juan
Why don't you simply just create a table function easily instead? In it you can handily use SQL which provides a practical MEDIAN aggregation function.
Simpels!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lars, thank you for your reply.
The problem with using a table function is that our front-end is designed to consume HANA calculation views from a repository, so defining a custom function and have the median calculated on runtime is actually not a viable option right now. Is that what you were suggesting or I missinterpreted you?
Best regards,
Juan
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.