I am attaching one qvw which I worked to get the query sorted out that I asked in this forum.
Well I got plenty of helpful topics in this forum, and qvw was created by help of QV forum people only. Please check, the input params and below bar chart populated as per input params.