Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
fineasfalco
New Contributor III

Get the dimension fields visible in a pivot table

Hi community,

I have to determine through a macro vb the number of dimensions visible in a pivot table.

The dimensions are dynamically shown / hidden through conditional expressions.

How can I get the current number of dimensions visible in the table?

Unfortunately GetProperties.Dimensions.Count returns all the dimensions , not only the visible ones.

Could you help me?

Tks

BR

Fineas

 

1 Solution

Accepted Solutions
Highlighted
fineasfalco
New Contributor III

Re: Get the dimension fields visible in a pivot table

Tks for your message. it's a good idea.

Unfortunately, My expression condition return 0 or -1 values (0 enable / -1  disable).

I have found a different solution with a macro.

Following an summary:

set chart = ActiveDocument.GetSheetObject("ObjectID")

set cp = chart.GetProperties

set dims = cp.Dimensions

the instruction condExp = dims(t).EnableCondition.Expression   return the t-th expression condition .

then for each pivot dimension fields I can evaluate the expression condition.

if the condiction is equal to 0 then the dimension fields is visible and a counter can be incremented.

Regards

View solution in original post

2 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Re: Get the dimension fields visible in a pivot table

I think I wouldn't try it with a macro else counting/summing the conditional expressions. Assuming that each conditional expression returned 0 or 1 you could use: rangesum(cond1, cond2, ...) to get the number of active dimensions.

- Marcus

Highlighted
fineasfalco
New Contributor III

Re: Get the dimension fields visible in a pivot table

Tks for your message. it's a good idea.

Unfortunately, My expression condition return 0 or -1 values (0 enable / -1  disable).

I have found a different solution with a macro.

Following an summary:

set chart = ActiveDocument.GetSheetObject("ObjectID")

set cp = chart.GetProperties

set dims = cp.Dimensions

the instruction condExp = dims(t).EnableCondition.Expression   return the t-th expression condition .

then for each pivot dimension fields I can evaluate the expression condition.

if the condiction is equal to 0 then the dimension fields is visible and a counter can be incremented.

Regards

View solution in original post