Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

How can we calculate median by partitioning the table based on few fields in sql scripted calculation view

$
0
0

We have a requirement to calculate median based on material. So if we following table

 

Material    Time

  A              3

  A              4

  A              5

  B              6

  B              7

  B              8

 

We expect the output to be

 

Material    Time     Median

  A              3            4

  A              4            4

  A              5            4

  B              6            7

  B              7            7

  B              8            7

 

on wrting the below sql code

  median (time) over (partition material)

 

is running fine sql editor, but in sql scripted calcuation view, we are getting an error as not supported feature.

 

 

Has anyone else faced this issue ?

We are using HANA SP9


Viewing all articles
Browse latest Browse all 6412

Trending Articles



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