By "top of rib" do you mean at the very first rib? Is it upper or lower back? Could be kidney if lower back.
I've had a pain just under my left ribs for 4 yrs. or more. Nothing shows up on scans and nobody seems to know what it is. Sometimes it's so bad I have to take ibuprofen 800 or Lortab for it. Usually, it's just annoying. I have thought it could be my pancreas or spleen, but nothing unusual shows up. And my blood work is fine.
If your pain was less than a week old, I would be inclined to think "muscle strain," but since you've had it a month I doubt that's it. If you find out, please post! It might give me an idea of what's going on with me.
P.S. I don't have any fluid retention, so that's not the answer with my symptom.