Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
antyinteligent
New Contributor

expand only one field value in a pivot table (on open action)

Hi,

I'm reloading a dashboard daily. The Date is the primary dimension in a pivot table. I'd like to write a macro which would be run on open which would firstly collapse all [this is easy "TableProperties.PivotAlwaysFullyExpanded = False"] but then I'd like to expand the max(Date). I'm looking in "API Guide version 11" but i cannot find the property that is responsible for the field/cell being collapsed or expanded, could anyone help with this?

Regards

AM

Tags (2)
5 Replies
Not applicable

Re: expand only one field value in a pivot table (on open action)

Czesc Andrzej!

I would approach it with the use of bookmarks. Create bookmarks with all states of collapse / expand you need.

(You would need to utilise "Include Layout State" option of bookmark)

Then in macro just set a proper bookmark.

Attaching sample app, which utilises buttons, but you can easily add macros:

ActiveDocument.RecallDocBookmark "MyBookmark"

BR,

Kuba

antoniotiman
Honored Contributor III

Re: expand only one field value in a pivot table (on open action)

Document Property -> Trigger

On Open Document

Select in Field

Field : Date

Value : =Max({1} Date)

antyinteligent
New Contributor

Re: expand only one field value in a pivot table (on open action)

Thanks for the good hint but I'm afraid that it cannot be utilized here because each day a new date value comes and this one should be expanded while other should be collapsed. The use of the bookmarks poses two problems here:

1. I wold have to create a table of dates in advance and for each of them I would have to create a bookmark

2. This is to be a long lasting project so it would have to be a long list of bookmarks [If i were to set up a bookmark via code i'd still need to know how to set the expand/collapse state that i require]

If I misunderstood your idea please let me know.

Not applicable

Re: expand only one field value in a pivot table (on open action)

Hello Andrzej,

Sorry, somehow I missed the most important information, that you want to always exapnd a cell not a whole column.

As per my knowledge you can only collapse all / expand all via macro, not specific columns in a table, so this is not an option.

How about just adding additional fully expanded pivot table, showing information only for max(date)?

BR,

Kuba

antyinteligent
New Contributor

Re: expand only one field value in a pivot table (on open action)

Hi,

it's a good suggestions. If there won't be any reply regarding the cell property i think I'll go with this one. Thank you

AM

Community Browser