Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Pivot Table move dimension to the header by macro

Hi All,

Please provide how I can move dimension to the cells header by macro

Before

error loading image

After

error loading image

Thanks a lot

5 Replies
pgamarra
Contributor
Contributor

Hi,

This procedure can help you:

sub Example

set

Chart = ActiveDocument.GetSheetObject("CH234")

Set

Prop = Chart.GetProperties

Prop.TableProperties.NumberOfLeftDimensions = 2



Chart.SetProperties Prop













end sub











By this procedure, the first two dimensions stay in the left side and the other ones go to the header.









Replace the objectID by your objectID, and change the number of left-dimensions according your requirements.

God bless you.

Percy









Not applicable
Author

Good example !!! it works .

One question here , how you get all these different properties alongwith description from ?

Bhushan N

pgamarra
Contributor
Contributor

I found all information exploring the APIGuide.qvw aplication in the QlikView documentation directory (In my case:"C:\Program Files\QlikView\Documentacion") and looking for some threads in this forum.

God blessy you

Percy

Not applicable
Author

Hi,

I'm new to Qlikview and I have the same problem, but I don't know how to apply the procedure mentioned here.

Please help.

Thank you.

Not applicable
Author

Hello,

I did the same thing you suggested and I was able to moved the dimension to the header row. But, now I am having a hard time making those dimension values bold. I tried the following code (using the api.qvw). However, the funny thing is it works when my dimension is vertical and when I move it to the header row, only 3 cells get the bold format and the rest don't. Any ideas? Appreciate your input on this. Thanks!

set chart = ActiveDocument.GetSheetObject("CH05")

chart.AddDimension x

set gp2 = chart.GetProperties

set dims2 = gp2.Dimensions

set bce = dims2(dims2.Count-1).AttributeExpressions.TextFmtExp

bce.Definition.v = "'<b>'"

gp2.TableProperties.NumberOfLeftDimensions = dims2.Count-1