# Pivot table: multible column widths for expr. X based on dim. Y

Hi!

I have thought a lot about the naming of this thread so hopefully it makes sense [:|]. I have the following pivot table object in the enclosed QV application:

The object includes two calculations where Calc1 is only calculated when DIM_2 = A and Calc2 when DIM_2 = B.

Now - what I want to do is obviously to hide Calc2 when DIM_2 = A and Calc1 when DIM_2 = B or alternatively to use a macro to set the column width to 0.

Obviously, the problem is, that e.g. Calc2 is the same column under both DIM_2 = A and B, so changing the width under A will reflect the same change under B.... [:^)]

Is there a way that you can set multible widths of the Calc1 and Calc2 columns?

Regards,

• ###### Pivot table: multible column widths for expr. X based on dim. Y

Hi Lars,

I do not think it is possible to have more than one width on the same expression in a chart. A possible solution is to have multiple versions of the chart with teh same position on the screen but different column widths and to use a show condition to show the relevant chart given the selection on DIM_2. ie if B is selected suppress the A chart and show the B chart and vice versa.

Kind Regards,

Footsie

• ###### Pivot table: multible column widths for expr. X based on dim. Y

Hi Footsie

Thanks for the reply - I think you are right that this approach would work out in some cases. It's still a problem if I need both A and B visible at the same time but your proposal got me thinking

Regards,

Lars

• ###### Pivot table: multible column widths for expr. X based on dim. Y

Hi Lars,

You could have a third copy of the chart and in the show condition use getselectedcount(DIM_2)=0. This means you will have 3 charts altogether. Three charts might be a bit of a pain in terms of maintenance but it is a solution.

Kind Regards

Footsie

• ###### Pivot table: multible column widths for expr. X based on dim. Y

Hi Lars,

In such case you need to have 3 tables, one when nothing is selected and rest two based on selection. I know its not a good solution. but sometime we need to do like this.

OR rather I can suggest you to add a new column in your script, and in pivot tabel chart, you can have a calculated dimesnsion, where you can define if(value=a, X col ,b ) something on

Regards,

Amit

• ###### Pivot table: multible column widths for expr. X based on dim. Y

Hi!