If the pain is radiating Down to the leg and progresses down to sole and you also notice some weakness associated the definitely it is sciatica ( compression of sciatic nerve) else it is just another compression of some nerve.
Not to worry Simply strengthening your back musculature by Bridging exercise will do most of the trick. (the TREATMENT PART)
Stretching of Hamstrings, Piriformis is going to help you even more. (ALTERING THE CAUSES)
Adding Change in Lifestyle Activities and Work Culture. will make it Complete. ( COMPLETELY REMOVING THE ROOT CAUSE OF CAUSES)
consider consulting and Occupational Therapist, or / Physiotherapist (in order of priority) to see and feel the change. If by any means you want to see the extent of nerve compression you can opt for MRI (because you already feel the extent of nerve compression)
earlier you conult, better will be the end result. STAY HEALTHY
The pain in the back coming on to the leg and knee indicates the nerve supplying the leg is getting compressed and or irritated in the back .
Pls consult a Spine Specialist for a through clinical examination. Initially depending on you clinical findings X ray might be done and medicines prescribed followed by Physiotherapy.
If signs are severe or of the pain is not reducing by treatment or in case of nerve deficit MRI might be done to plan the further treatment.