I am trying to build something as you did . Progmatically I want to set what columns should be in pivot. For some reason I am not able to get it working. Any other things that I need to set for qNoOfLeftDims to work? below is the code. I see pivot table rendering but all dimensions are on left. Ideally in below example I want "year" to be at top i.e. column grouped by year.