Hey there, I'm trying to create a % of total column for my dataset with various domains.
Issue is, there's multiple rows with the same values as others.
Tried to perform a group by domain then rank by video plays with a partition by url, but it is not working.
Thought maybe a window function could work, but I would need it to be distinct since each url is different.
I don't think it's possible to do for each domain individually cause my original dataset has 937k rows and about 30+ domains, but if I have to...
I also wanted to know, is there a way to perform rank if you have multiple rows with the same value?
Similar Example of my table
Domain | Video Plays | Topic | URL |
abc.com | 1 | Dinosaurs | abc.com/hgffdjnhgdjn |
bec.com | 214 | Hippos | xyz.com/gsGEG |
abc.com | 156 | Alligator | bec.com/agreah |
bec.com | 2 | Rhino | abc.com/gaggb |
dbhiaf.com | 269 | Bear | bhiaf.com/agregher |
efg.com | 569 | Deer | efg.com/fgfhgsh |
hikj.com | 45 | Kiwi | hikj.com/hfgshtf |
jijk.com | 92 | Platypus | efg.com/fdsGS |
efg.com | 92 | Narwhal | dbhiaf.com/gsgsge |
efg.com | 92 | Beaver | jijk.com/gsdagre |
efg.com | 879 | Ant | jijk.com/gdagaerd |
jijk.com | 214 | Kangaroo | dbhiaf.com/gahreah |
bec.com | 1 | Dolphin | abc.com/greagraeg |
dbhiaf.com | 2 | Giraffe | dbhiaf.com/graehaerh |
abc.com | 214 | Emu | xyz.com/agrage |
xyz.com | 300 | Mouse | xyz.com/fresgr |
jijk.com | 214 | Snake | jijk.com/cdsfaGF |
I think down the road, I will need to separate the domains from each other and locate % of total that way too, but that may be asking for too much.