Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Is there any macro available to hide first column expression of every pivot char

Hi Friends,

I am new to Qlikiview macros. I want to hide every first column of every pivot chart on the dash board. So that I can use along with

Pick(Dimentionality,1,2,3,4....etc) to sort the last expression always.

I got one Macro from one of our friends.

public sub MyHide
      call HideColumn("CH26",5)
end sub

private sub HideColumn(ch,n)
  set ch = ActiveDocument.GetSheetObject(ch)
  ch.SetPixWidth (n), 50
end sub

Can I tweak this macro to to apply to every pivot chat I use....

Thanks

Tags (1)
3 Replies

Re: Is there any macro available to hide first column expression of every pivot char

Yes but you have to repeat the instruction

call HideColumn("CH26",5)


defining all the objects (as CH26) where you need to hide the column.

Not applicable

Re: Is there any macro available to hide first column expression of every pivot char

If I give Same object ID for every pivot chart the pivot charts are disappearing.

Is there any way I can group all this pivot charts and use the group name in the macro???

Thanks

MVP & Luminary
MVP & Luminary

Re: Is there any macro available to hide first column expression of every pivot char

The object ID has to be absolut unique within an app. If you renamed it to an already existing object this object will be overwritten. If you want to do your task with a macro you need to repeat it like Alessandro suggest or you wrapped this code into a loop which runs through all sheet-objects - see here an example from APIGuide.qvw which make such sheet.object run:

rem  ** remove borders from all listboxes on active sheet **

set x = ActiveDocument.ActiveSheet.GetSheetObjects

Objects = x.SheetObjects

For i = lBound(Objects) To uBound(Objects)

      set obj = Objects(i)

      if obj.GetObjectType = 1 then          'list boxes

            set p = obj.GetProperties

            p.Layout.Frame.BorderEffect = 0  'no border

            obj.SetProperties p

      end if

next

It would only be a starting point for further adjustments ... But what is really your aim? You need really many from these special pivot-charts that an automated approach would be useful. Further, an expression could be better to hide per expression-condition.

- Marcus