I have a table like this :
Id Sym sum_amount pair
11 2 1000 1
11 3 500 1
22 4 200 2
22 4 50 2
And I would like to divide one value in a pair in the second in the same pair over partition by Id, Sym.
and get those results:
Id Sym sum_amount pair Div
11 2 1000 1 2
11 3 500 1 0.5
22 4 200 2 4
22 4 50 2 0.25
I think I will need something like this:
Ratio[???](Sum_Amount) Over (Partition by Id, Sym, pair)
Any way to do this? I know that can I average over the pair, sum etc but I don't know how can I do those ratios? are there a built in function for ratio?
Thanks.