I do understand what you're trying to say in the sentence, but it isn't quite right.
The first thing I notice is a bit of a contradiction. Note the bolded parts.
It must have been by the time I had been working just for a few weeks that a memorable incident happened.
Used here, "must have been," particularly but not exclusively with "by the time," makes it sound like it was a long time, and "just a few" makes it sound like it was very little time. The former doesn't necessarily mean that that, but it tends to have a fairly sentimental feeling to it, and that tends to highlight duration.
On top of that, using "that" here seems a little awkward. I would probably prefer "when," because we're talking about time.
I think a better way to phrase that sentence might be,
I had been working for just a few weeks when a memorable incident happened.
Alternatively,
It must have been five years since I first went to a club.
As far as an "it...that..." construction is concerned, I can't think of many times when that really sounds natural. A few that do occur to me off-hand are,
- It has been so long that I've forgotten.
- It is interesting that you say such a thing.
Although each of these are cases where the sentence could be very (perhaps more) comfortably formed without the word "that" in them, so I'm not sure how much they even count.